• Resolved lewisp91

    (@lewisp91)


    I’m using a spinner but I cannot see a way to create 0.1 increments.

    Right now, numbers go from 1, 2, 3, etc.

    How can I set the spinner to go 1.1, 1.2, 1.3, etc. ?

    • This topic was modified 1 year, 10 months ago by lewisp91.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @lewisp91

    Thank you very much for using our plugin. Assuming the number field is the fieldname123, please, insert an “HTML Content” field in the form and enter the following piece of code as its content:

    <script>
    fbuilderjQuery(document).one('formReady', function(){
    getField('fieldname123').set_step(0.1);
    });
    </script>

    Best regards.

    Thread Starter lewisp91

    (@lewisp91)

    Thank you so much, that worked!

    There was a small issue with the numbers as you increased the spinner, such as going 1.1, 1.2, 1.3, then, instead of 1.4 it becomes 1.399999999999999.

    I think this is due to how Javascript handles floating point numbers, but I managed to fix it with some additional Javascript that rounded the numbers.

    Thank you again.

    • This reply was modified 1 year, 10 months ago by lewisp91.
    Plugin Author codepeople

    (@codepeople)

    Hello @lewisp91

    My apologies for the delay in responding to your entry.

    We’ve released a plugin update (just now) that includes the following modifications:

    • We have edited the Number and Currency controls to support the step attribute. So, you would not need any additional code, only enter the step value through the fields settings.
    • Furthermore, we have modified the slider control to make the decimal places in the results more consistent. It will have the same number of decimal places as the step attribute. So, in this case, you can remove the HTML Content field with the custom code.

    Best regards.

    Thread Starter lewisp91

    (@lewisp91)

    Wow, you work fast! I just tested the new features and they work perfectly. Thank you so much.

    Your dedication to the plugin really shows. Keep up the good work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to set spinner increments?’ is closed to new replies.