• Resolved muzicutza81

    (@muzicutza81)


    Hello dear @codepeople,

    I have yet another question for you. I have a number field on our form. I set it to digits as I want to ensure that the numbers keyboard is by default pulled up on mobile browsers. I added the following code to allow a step of 0.01:

    jQuery(document).ready(function($){
    $( “#fieldname8_1” ).attr( “step”, “0.01” );
    });

    When I try to enter a value with a decimal point however, the validation still fails stating: “Please enter only digits.”

    I inspected the element and it looks like the step was applied but I am still getting this error. How can I fix this?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @muzicutza81,

    Please, remove your code, and insert a “HTML Content” field in the form with the following piece of code as its content:

    
    fbuilderjQuery(document).one('showHideDepEvent', function(){
    fbuilderjQuery('[id*="fieldname8_"]' ).prop( 'step', 0.01 ).removeClass('digits');
    });
    

    and that’s all.
    Best regards.

    Thread Starter muzicutza81

    (@muzicutza81)

    Awesome, thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number field with decimals’ is closed to new replies.