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 can I populate fields from a dropdown entry?

    Asked by GAPTAOnline on March 01, 2014 at 11:26 AM

    I have a registration form that requires selection from a dropdown field for the name of a local unit.  There are three other fields that have information needed based on the dropdown selection (local unit number, council and district.  I currently have these ina spreadsheet with the values for each, how can I populate the remaining three fields based off of the selection of one?

     

    Page URL:
    http://www.jotform.com/?formID=40568378022961

    registration form dropdown field name Selection
  • Profile Image
    JotForm Support

    Answered by Welvin on March 01, 2014 at 02:28 PM

    Hi,

    Basically, what are you trying to do is to keep the remaining three fields "empty" then just populate it after a selection from the first field? The remaining three fields has an options so I assumed this is what you are trying to do.

    An example that would explain how I understand your requirements here: https://shots.jotform.com/welvin/pages/change_dropdown_options-base-onthe-first-dropdown-selection.html.

    Let me know your thoughts.

    Thanks

  • Profile Image

    Answered by GAPTAOnline on March 01, 2014 at 05:57 PM

    That is exactly what I want to do.

  • Profile Image

    Answered by Cesar on March 02, 2014 at 12:24 AM

    As you can see by Welvin's example form, he has been able to achieve this behavior from the dropdown menu, by utilizing Javascript and arrays to display the proper model for each make adding this to the source code of the form.

    Here is the code used

    Kindly review. Do let us know if you need further assistance. Thank you.

     

  • Profile Image

    Answered by GAPTAOnline on March 02, 2014 at 08:14 AM

    Unfortunately, I am not a devleoper. How do I identify the other fiels that are in the sequence to populate in the code. I realize that I would have to do this for each option and that will be fine, There would not be an array of selections for the remaining areas simply one.

  • Profile Image

    Answered by NRCsupport on March 02, 2014 at 10:10 AM

    Pardon me (I'm not official round here)

    I believe there is a simple solution using conditions. Then you don't need to program JavaScript yourself.

    As an example assume that there are four entries in the first dropdown box (box1). Then create four further dropdown boxes (boxA,boxB,boxC,boxD), one for each of the entries in box1. Put the following conditions on the form using the wizard:-

    if field box1 is equal to value1 then show field boxA
    if field box1 is equal to value2 then show field boxB
    if field box1 is equal to value3 then show field boxC
    if field box1 is equal to value4 then show field boxD

    The wording may not be exactly correct, but I'm sure you get the idea. The wizard isresponsiblr for the actual wording.

  • Profile Image

    Answered by Cesar on March 02, 2014 at 11:39 AM

    As suggested by NRCsupport, this is also possible by way of making the necesary amount of drop down menus and setting up the right Conditional rules, like so:

    http://form.jotform.co/form/40604300029843

    This is how I've added the rules to my example form:

    https://shots.jotform.com/cesar/screens/showhideoption.png

    And These are the rules I have applied:

    https://shots.jotform.com/cesar/screens/secondselectiondropdown.png

     

    Kindly clone my example form if you need to further review it, Thank you.

  • Profile Image

    Answered by GAPTAOnline on March 02, 2014 at 11:54 AM

    The field is hidden but the value is not displayed in the field.  I am okay to try the java piece to have the fields populate the intended value as the values would be similar to: Local unit selected equals value of Forest Park ES, the other values would be lu = 1698, council = clayton, district = 7.  How can I get the additional fields int he script?

  • Profile Image

    Answered by Cesar on March 02, 2014 at 01:04 PM

    I believe Welvin may be able to provide a solution to your current questio. In any case, my opinion would be, If each value will render the next value on the next dropdown menu. Then you may need to create a script for each field being updated.

    So you would need to set the proper onchange value on the initial dropdown. https://shots.jotform.com/cesar/screens/javascript0103.png

     

    Then have the proper script with your required arrays to make the changes on the second dropdown.

    This will all depend on how many dropdown menus you are using and which will make changes to whom. 

    Do let us know if you need further assistance. If needed do provide the values in question. Thank you.

  • Profile Image

    Answered by GAPTAOnline on March 03, 2014 at 10:47 AM

    I will need additional assistance in trying to duplicate Welvin's solution.  The fields that are populated after the selection of one dropdown (the local Unit field) will populate the input for the remaining three fields. 

  • Profile Image
    JotForm Support

    Answered by EltonCris on March 03, 2014 at 11:30 AM

    @GAPTAOnline 

    For clarification, can you confirm if this is want you want to achieve?

    If Local Unit Number = 1698

    Council = Clayton

    District = 7

    So basically, when a number is entered on the Local Unit field, you want these two fields to have default values according to the entered LU number? Just wanted to clear my confusion. My colleague Welvin will definitely provide you a sample script as soon he can.

    Thanks!

  • Profile Image

    Answered by GAPTAOnline on March 03, 2014 at 11:37 AM

    The selection is based on the selection of the name instead of the local unit number.

    If PTA name is = Morrow ES PTA

    Local Unit Number = 1698

    Council = Clayton

    District = 7

    So when the name is selected three default values are entered.

  • Profile Image

    Answered by EliezerN on March 03, 2014 at 12:58 PM

    @GAPTAOnline

    Thanks for the clarification. My colleague will get back to you once he has the neede script to accomplish what you need.

    Thanks

  • Profile Image

    Answered by GAPTAOnline on March 05, 2014 at 05:22 AM

    Is there any status on development of script?

  • Profile Image
    JotForm Support

    Answered by Welvin on March 05, 2014 at 06:29 AM

    Hi,

    My apologies! I actually tried this on the day you've posted this thread, but I couldn't figure out how to combine all the last three fields. Also, it's a huge list of options. We'll see if what we can do to make the adjustments but again, we cannot give you the exact timeframe for the output.

    Thanks for your patience and understanding.

  • Profile Image

    Answered by GAPTAOnline on March 05, 2014 at 06:35 AM

    Should I seek another option? Normally, I would have a lookup query to use against a database or excel spreadsheet, however, I don't think this is supported for use in jotform.

  • Profile Image
    JotForm Support

    Answered by jonathan on March 05, 2014 at 08:06 AM

    @GAPTAOnline

    Hi,

    It is possible to use lookup query via database and pre-populate the form.

    It will require outside the form coding using PHP. 

    But to further this different topic, I suggest you create a separate thread for it. Use this link to do this http://www.jotform.com/contact/

    Thanks.

  • Profile Image

    Answered by GAPTAOnline on March 05, 2014 at 08:45 AM

    I have created a separate thread.