What are Pre-populate Form Fields?
Often a form will contain several generic fields that many respondents will answer in the same way. Rather than making users fill in these fields, which can be repetitive and time-consuming, you can pre-populate form fields with the correct information so that, when users open the form, these fields will already be filled in. To do so, you will need the form’s URL and the variable names associated with the fields they want to fill in.
Create a URL Structure
Field values can be passed into a form by appending them to the form’s URL using the following structure:
baseURL?variable1=value
Replace baseURL with the site URL followed by the form’s URL, variable1 with the name attribute
associated with the field to be filled in, and value with the appropriate plan's ID
value. To fill in multiple fields, insert the ampersand symbol (&) before any additional variables:
baseURL?variable1=value&variable2=value
For Example:
https://your_site_url/membership-setup-page/?subscription_plan=2
The result of above example will be like – the plan with plan ID value 2 will get selected.
Follow these steps to set up a pre-filled field
Important Note: When you pre-fill these fields, the member filling out the form will have the ability to edit them. Therefore, it is not possible to set these fields as non-editable.
- Get your site URL. For example https://yoursiteurl.com
- Gather all the field name’s meta keys so that it can be added to the URL. For suppose here we are considering the meta_key as
display_name
(meta_key to pre-populate form fields the “Display Name”) - In order to get the meta key, you can navigate to from ARMember ⇾ General Settings ⇾ Edit preset fields.
- Once you have its meta key, then you can add this at the URL and then add the value you want to show pre-filled. Just as the below example:
For Example:
https://yoursiteurl.com/register/?display_name=armemberplugin
The above example will pre-fill the Display Name field at the registration form as armemberplugin
- As soon as your URL structure is ready then you can use it to any of the button or at any page, and then when anyone clicks on the URL then they will be able to check the form will fill with the field name that is passed at the URL automatically.