What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Is there a randomization and select tool, or can I do double if then logic.

    Asked by Jinkfenn on May 22, 2017 at 08:47 AM

    I need my job form to randomly choose 1 of 8 questions and present it, while hiding the others. Is there a simple way to do this? Right now, I have to use a random generator and then assign numbers to each condition, which is sort of working, but not ideal. 

     

  • Profile Image

    Answered by williamralloma on May 22, 2017 at 09:19 AM

    Using random function in Form Calculation  is the ideal way to do this as of now. Here's how you add one.

     

    1. Setup Calculation widget.

    The random() function generates a number between 0 and 1, so multiplying it by 10 we get a random number between 0 and 9. As we want to be able to use a nice and round number, we place this within the round() function.

     

    2. Set up conditions

    Since we have 5 fields and 10 numbers, we can grab 2 numbers for a specific field, so if it is 0 or 1, first field is shown, 2 or 3, the second field, etc. These numbers however do not need to be set like this, they can be set in any manner, so 0 and 9 to show the third field will work as well, as long as we keep the configuration with 2 numbers for a single field and cover all of the numbers and fields.

     

    So this is how it looks set up:

     

    3. Hide the Calculation widget.

     

    To hide, click on the widget, and select the option to hide it (available after clicking on the gear wheel):