LX Adjust Field is an adjustable numeric value that uses familiar UI from games and application (plus / minus buttons). It can be assigned a pool of points and other restrictions.
Requires: jQuery.
How to use it:
Load the form helper class as you would normally using this line:
$this->load->helper('form');
After that, you can add the adjust field by using the line echo form_adjust($name,
$starting_value,
$is_numeric,
$point_increment,
$value_increment,
$min,
$max
); The only required values are the $name and $starting_value.
If you wish to display a "Point pool" you must add a label with id points_left, and if you wish said point pool to be submitted, you may also add a hidden input with id points_left in your markup. Example:
and
Parameters:
$value_increment => This input sets the amount of points added/substracted to the field value on each click. Default value is 1.
$min => No matter how much you click the "minus" button, the value will not go below this value. Default value is -1000. Can also be a character.
$max => Same thing... Default value is 1000 and can also be a character.
Questions & Comments