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 way to pre-populate a text field based on a dropdown selection field?

    Asked by FuneralStudio01 on February 06, 2014 at 12:39 AM

    I am looking for a way to create a prepopulate a text field with a value based on a selection from a dropdown list.

    Is there a way currently to do this? Apart from creating separate text boxes with prepopulated data and using the condition rule for each value selected in the dropdown list?

    ie. Heading is Cafe Name (Dropdown selection is) Jims Cafe then I would then like the Text Field to be prepopulated with the address (5 Smith Street, Smithville) etc.

     

    With Thanks

    text field Selection heading name dropdown list
  • Profile Image
    JotForm Support

    Answered by ashwin_d on February 06, 2014 at 01:56 AM

    Hello FuneralStudio01,

    Unfortunately, there is no built in feature to achieve this.

    But with a little work around, it is possible to populate your textbox based on the value of dropdown selection. You will have to download your form's source code and add some custom JavaScript code.

    I have created a small demo form for you. Please take a look at the following form and see if you are trying to achieve something similar:  https://shots.jotform.com/ashwin/Prepopulate%20textbox%20with%20dropdown%20value_(40361098635961)/Prepopulate%20textbox%20with%20dropdown%20value.html

    Alternatively, you can add multiple address field in your form and hide the others based on the dropdown selection value. Please take a look at the following form:  http://form.jotformpro.com/form/40361060487955

    Feel free to clone this form for a closer look. This guide should help you in form cloning: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    If you want to take the custom source code route, do get back to us with the form ID and we will send you the specific custom code.

    Thank you!

  • Profile Image

    Answered by FuneralStudio01 on February 06, 2014 at 05:23 PM

    Hello Ashwin_d,

    Thank you for your prompt reply Yes your example:- https://shots.jotform.com/ashwin/Prepopulate%20textbox%20with%20dropdown%20value_(40361098635961)/Prepopulate%20textbox%20with%20dropdown%20value.html

    Is just what we would like to do thank you. Is it easy to change the custom source code to add future Bussiness Names and Addresses down the track? If not we will probably use the show/hide rule.

    Form Url is: http://form.jotform.co/form/40288132806857 (Where "Funeral Venue (Test)" is the dropdown list where we need to put our Venues and "Funeral Address (Test)" is the text field to be prepopulated with the venue selection address.

     

    With Thanks,

  • Profile Image
    JotForm Support

    Answered by Welvin on February 06, 2014 at 06:45 PM

    Hi,

    I have forwarded this thread to my colleague Ashwin for the complete workaround. I will also try to come up with a possible working codes.

    Thanks

  • Profile Image

    Answered by FuneralStudio01 on February 06, 2014 at 06:52 PM

    Thank you Welvin,

    Appreciate your help.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on February 07, 2014 at 03:35 AM

    Hello FuneralStudio01,

    It should not be too difficult to change the source code to add more business names. But you will have to download your form's source code and embed it again after adding the custom code.

    I have cloned your form and added the custom JavaScript code. Please check the following form : https://shots.jotform.com/ashwin/Clone%20of%20Listing%20Only%20Order%20Form_(40371245828960)/Clone%20of%20Listing%20Only%20Order%20Form.html

    If this is acceptable to you, I will remove the old (test fields) and transfer the form to your account. I will also send you the source code of this form.

    Thank you!