Skip to main content
Logo
There is a newer version of Contensis. Click to find out more and download the latest version.

Pre-populate form fields

There are a number of scenarios where you may want to pre-populate form fields, for example you may be using the jobs module and have a job application form where the job reference and title are filled in automatically for the user. To pre-populate form fields you will need to pass the value to the form via the URL. This can be done by targeting each of the form fields via its unique ID.

Find the unique ID

The easiest way to see the unique IDs for your form is to click through to the Form Settings area when editing your form and click on the How to pre-populate the form fields button. This will bring up a window with instructions and provide you with a list of all your form fields with their unique ID alongside.

Populate the form field

For this example we'll assume you are trying to pre-populate the job title field, the ID of which is f01. Take a look at the URL below to see how we target each field.

http://www.mydomain.com/form.aspx?f01=Superhero

As you can see, we are adding on a question mark, followed by the unique field ID, an equals sign and then the value for the form. If we want to add more fields we simply suffix an & sign after the job title and then follow the same process again with the & instead of the question mark.

http://www.mydomain.com/form.aspx?f01=Superhero&f02=Must%20enjoy%20fighting%20 crime

The data inside the URL will be URL encoded. Click here for more information about encoding URL's.