Testing whether a Form Calculation result is an integer

  • bhds
    Asked on February 22, 2017 at 4:07 PM

    Hello.

    I have set up a form which parents of students in our school can use to order various items.  The order has to have a total of 15 items - I was able to implement this by setting a condition whereby the Submit button is hidden if the total number of items ordered is not 15.  The number of items ordered is held in a Form Calculation field called "Elastics Count".

    We would, however, like to make this order form more flexible and allow customers to order items so long as the total number ordered is a multiple of 15.  I have added another Form Calculation field at the bottom of my form called "Number of packs", which is basically the number in "Elastics Counts" divided by 15.  Is there a way of testing whether this value is a whole number, and hiding the Submit button if it isn't?

    Alternatively, is there another way that I can hide the Submit button if the total number of items being ordered is not a multiple of 15?

    Thank you.

  • Kevin Support Team Lead
    Replied on February 22, 2017 at 7:28 PM

    I have checked your form and it currently seems correct in the calculation made on "Number of Packs", now if the result is a decimal the submit button will not show, but if it is an integer then the submit button should be displayed. 

    The condition you need to add to your form is like this one: 

    Testing whether a Form Calculation result is an integer Image 1 Screenshot 20

    Here's a sample form, type any number and if the result is integer the submit button shows: https://form.jotform.com/70527325851961 

    If you have any question, let us know. 

  • bhds
    Replied on February 23, 2017 at 8:54 AM

    Thank you - that works very well.