How to add validation for "spinner" questions.

  • KeyshaunSmith
    Asked on February 21, 2016 at 11:40 AM

    How to add validation for spinner questions Screenshot 20I would like to set a condition in which it states that "Number of Returning Students Enrolled" cannot be greater than Total Number of students enrolled. 

     

    Any help would be appreciated! Thanks! 

  • Elton Support Team Lead
    Replied on February 21, 2016 at 2:16 PM

    Add a text message below the second spinner field and then create a condition that shows it once the condition is met.

    Example:

    Let's assume this is the form.

    How to add validation for spinner questions Screenshot 30

    Here's the condition:

    How to add validation for spinner questions Screenshot 41

    Demo: https://form.jotform.com/60515288442961

    In this condition, I added a DO action that hides the submit button so they cannot submit the form if spinner B is greater than spinner A. In your form, you can hide the pagebreak button so they can't proceed to the next page instead of the submit button.

    If you need further help, let us know.

  • KeyshaunSmith
    Replied on February 22, 2016 at 10:11 AM

    Hello Randy:

    This looks awesome! But how do I get it into my form?

    Thanks!

  • Charlie
    Replied on February 22, 2016 at 12:19 PM

    @grade4pagasa

    Thanks for sharing your ideas here in the forum. Currently, I don't see a duplicate or double post. Someone from the support team might have already deleted it. 

  • KeyshaunSmith
    Replied on February 22, 2016 at 1:29 PM

    Hello Randy:

    I did add the 3 conditions that you have listed above.

    How to add validation for spinner questions Screenshot 30

     

    This did not have the same result as you are showing above. In fact it is responding as if the conditions don't exist at all.

    How to add validation for spinner questions Screenshot 41

  • Ben
    Replied on February 22, 2016 at 4:48 PM

    Randy is correct in regards to the conditions operators. It is also important to note that the ordr of conditions can affect what happens on the form as well (in many cases).

    Thank you Randy for another nice solution :)

    @KeyshaunSmith In case the cloning part gives any trouble, this guide should help: How to Clone an Existing Form from a URL

    Now I would like to add my suggestions as well.

    1st - if you want the total to always be higher than the one under it, we set the conditions as so:

    How to add validation for spinner questions Screenshot 40

    https://form.jotform.com/60526605216955

    Basically they can add as many "enrolees" as they wish and the total will always update +1 instead of allowing them to be higher than the same.

    2nd - increase total as the other spinner is changed (if needed)

    Basically this is the same as above, just without +1 segment.

    - When is this useful? Sometimes people know exact number of one item / people, while they can not remember exactly how many of another they should set, in this case, they can simply set the number under it to any and have the total updated for the same count.

    This is the condition:

    How to add validation for spinner questions Screenshot 51

    This is the demo form: https://form.jotform.com/60526576803964

    3rd - block the entry by transferring the value from the total field

    Basically if the 2nd field wants to be larger than the total, we just give it the value of a total and instant block.

    This is how the condition looks like:

    How to add validation for spinner questions Screenshot 62

    https://form.jotform.com/60526273586966

    Hope that one of them will be of help. It is however good to note that only a single one of them is needed - not all, so you can use the one that suites you best.

    This is the link to the cloning guide if you wish to get a closer look into the form: How to Clone an Existing Form from a URL

    Just to mention that are few other alternatives as well, but they result in bad UX while above seem to work properly. I would however still include a message under the spinner to explain what happens with the same fields - avoiding any confusion at a later time.