Can I pass a value into a hidden form field?

  • subwayo2wifi
    Asked on September 16, 2013 at 12:45 PM

    Hi There,

    here's what we'd like to do:

    user comes to page A, which basically shows a world map, with highlightable, clickable regions.

    The user clicks on a region e.g. Europe. 

    The page refreshes, showing a jotform containing a list of European countries and the rest of the form (a normal iframe emdedded jotform).

    If, instead, they'd clicked on the map of North America, then the page would refresh, but showing a list of countries in North America (US or Canada).

    Basically, is there a way to pass values into a hidden field (called 'region' for arguments' sake) that we can then use that value to enable conditional stuff to happen (such as showing or hiding a field)?

    If not, can you think of a way we could do this?

    Had a look through the advanced help stuff, but couldn't find anything.

    Cheers,

     

    Frank

  • Ashwin JotForm Support
    Replied on September 16, 2013 at 2:16 PM

    Hello Frank,

    Yes that's very much possible. You may like to check the url parameter options which will help you pass values to a hidden form field. 

    What can be done is, you can add a hidden form field in your form and then pass value into this hidden field through url parameters. You can create conditions on the hidden form field to show/hide any other field. Here is a guide which should help you understand url parameters:  http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters

    On requirement similar to yours, I have created a demo form for you:  http://form.jotform.co/form/32524096571859?email3=ash@gmail.com&name=Ashwin&hidden=Ash

    This form has 4 fields name, email, hidden and a text field to show the value of hidden field on a condition. If you see the above form url, apart from populating the email and name I am also sending value for hidden field. I have also set a condition where if the value of hidden field equals "Ash", it will display one more textbox.

    Hope this helps.

    Do let me know if you have additional questions.

    Thank you!

  • fmCorp
    Replied on February 5, 2014 at 4:12 PM

    I have a similar scenario, but can't quite get a conditionally hidden field to populate.

    http://form.jotform.ca/form/40265506082247?chapter=3 

    This works fine *if* the form field isn't hidden. However, using conditions to hide the field doesn't work:
    - If *chapter* field *Is Filled* 
    - Then *Hide* *chapter* Field

    If you go the form when the condition is applied, no value is ever written to the field, and thus never submitted with the form.

    Any idea? 

  • jonathan
    Replied on February 5, 2014 at 4:18 PM

    @fmCorp

    Please create a new separate thread regarding your issue.

    Use this http://www.jotform.com/contact/

    You can just copy and paste your message from here to the new thread you will create. Provide the appropriate subject/title in the question.

    We will attend to you at once.

    Thanks.

  • bobbyrenaud
    Replied on February 21, 2017 at 11:30 AM

    But is URL the only way

    Can't I pass the value via the field names including the `q?_` preceding  it?

    eg.   q?_myHiddenField 

     

    Also... what are these for? 

    They all seem funny when you have more than 1 hidden fields. 

    UNIQUE NAME

     }

    FIELD IDs

    #hidden_4

  • David JotForm Support Manager
    Replied on February 21, 2017 at 12:44 PM

    @bobbyrenaud, your question will be addressed on the following thread: https://www.jotform.com/answers/1072153