LX Adjust Field

An easy way to create "adjust fields" in your forms - numeric values that can be adjusted (increased and decreased) dynamically using plus and minus buttons.

  • Language: PHP
    Framework: CodeIgniter
  • Released: Sep 2, 2011
    Last Update: Sep 2, 2011

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.

Example Code

Requires: jQuery.

How to use it:

  1. Link to the form_helper.js file.
  2. Add the MY_form_helper.php file to your CodeIgniter helpers folder.
  3. Load the form helper class as you would normally using this line:

    $this->load->helper('form');

  4. 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.

  5. 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:

  • $name => The name and id attributes of the input containing the value
  • $starting_value => The value from where the counting starts. You can also set a character as a $starting value, just make sure the next property is set to true.
  • $is_numeric => If true, the values will increase and decrease as numbers, else they will adjust as characters. Default value is true.
  • $point_increment => This sets how many points will be substracted/added from/to the point pool on each click. Default value is 1.
  • $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.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

License » GNU GPL Download
Post a comment

Or enter your name and Email
No comments have been posted yet.