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

    How do I create a condition that automatically selects an dropdown option in another drop down box?

    Asked by NYSTEM on June 01, 2012 at 10:21 AM

    I am trying to set up a condition using drop down boxes. I would like to create a condition that can automatically select a drop down box option. I know you can show or hide forms but is there an option to select options in the form.

  • Profile Image

    Answered by jeanettebmz on June 01, 2012 at 01:27 PM

    Unfortunately, this is not possible to accomplish through our conditons wizard

    However, a workaround could be to create the boxes and with some javascript code have them pre-selected ,  and show them when a dropdown option has been selected.

    However, in order to accomplish the pre-selection, once you finish adding the show/hide conditions to the form ,you would have to download the source of your form, and follow in some way the insructions my colleague Abajan has posted on this thread.

    Even though these instructions were done for a check box into a payment tool, they ilustrate an example for you.

    So for example: the function  document.getElementById("input_6_1001").checked=true;

    Where input_6_1001  is the element of the form on that example, can be replaced by your form's element id (your dropdown menu) 

    This is the complete sintax for the script

    <script type="text/javascript">document.getElementById("input_6_1001").checked=true;</script>

    Best regards

    Jeanette

     

  • Profile Image

    Answered by yo on August 31, 2012 at 01:55 AM

    on condition()

    document.getElementByID( ).childNode.selectedIndex=document.getElementByID(whose value is to assigned) ).childNode.selectedIndex