Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Action_Builder Posted March 26, 2016 Posted March 26, 2016 I have a custom field that is suppose to have negative and positive numbers. I have setup the custom field with the type as number. However, the record input form only has the ability to enter positive numbers. If I manually enter a negative number I get a message saying to check the field for an error. Any ideas on how to best record negative numbers? I want to do some calculations on these numbers using php in a template. I also want to sort by these numerical values. The range of the numbers will be -100 to 1000 or more. Should it be possible to enter negative numbers into a number custom field? Is this a bug in the IPS software? If the number field is not the best solution, what may be a good alternative?
Action_Builder Posted April 5, 2016 Author Posted April 5, 2016 Today IPS support responded to my bug tracker post. Allowing only zero and above is the default functionality. Therefore the following modification needs to be made in order to allow negative numbers: $form->add( new \IPS\Helpers\Form\Number( 'negative_number', $default, $required, $options = array( 'min' => -100 ) ) ); Does anyone know which template I need to modify?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.