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.
How do I populate a hidden field with a specific value based on a users selectionAsked by MyPartySupplies on October 20, 2016 at 01:55 PM
Let's say I have a list of cities:
and I would like to assign a 'region' to each of them and then populate a hidden field with a unique value based on the users selection.
So I have 2 regions
Now whenever a user selects London, Birmingham or Liverpool I would like to populate a hidden "region" field with either "UK" or a numerical value (1)
While if the user selects Berlin or Frankfurt I would like to populate the hidden "region" field with either "Germay" or a numerical value (2).
Essentially this consists of two tables with N entries where values in table 1 (Cities) match a corresponding value in table 2 (Regions)
How can I achieve this with Jotform?
Thanks in advance
You may populate the hidden field with a value based on the selection of another field using a set of conditions.
Please see the conditions set on the demo form with the list of cities in a dropdown and the region is a text box field.
You may hide the Region field on the form by selecting the Hide Field option from the field properties.
Please see the demo form below and feel free to clone it to your account.
Hope this information helps!
That works - but it could be very tedious if I have dozens (or hundreds) of
cities and regions. Is there any way I can populate this in a more
database-table like structure and then do a lookup from one to the other
based on the value?
*Region_ID | Name*
1 | London
1 | Birmingham
and a Regions table like
*Region_ID | Region_Name*
1 | UK
2 | Germany
3 | France
4 | other
and then do a lookup (where London for example would return a Region_ID of
1 which is mapped in the Regions table to "UK") - rather than a VERY long
Please let me know - thanks in advance.
Unfortunately, I don't see a way to that on a form itself. There is Matrix field for example, that you can use for a table, but, you can not use conditions to copy a value to it's fields, since you can not specify which data will go to certain field.
I'm thinking that best way for you to manage that is to integrate your form with Spreadsheets and manage your data there:
You will be able to search, review and to all necessary checkings right there.
Could something like that work for you?
Please let us know.