Easy Registration Forms allows to dynamically populate a Form field from a query string. One of the common use is to identify the source of submission. It can be easily achieved by just appending a parameter in the URL. This article will show you how to use query strings to prefill a form field.
What is a Query String?
Query string allows appending any information with a given URL. For example:
Here we are passing name parameter with a value john
It is a common approach to pass any information with the URL. Information can be used in the database or to provide any instruction to the server.
How to use
Our plugin comes with an in-built feature to dynamically populate a form field from the query string. The best part is that there is no additional step to set up this feature. You just have to append parameter within the URL and it automatically populates the related fields. Make sure that your parameter name and field’s label is identical. For example:
In the above URL, we are passing a default message value in our support form’s Message field.
You can even pass multiple parameters within the same URL by concatenating them with &:
Here we are passing the Website URL along with Message field.
*Note: If any of your field’s label contains space, replace it with an underscore while passing them in URL.
You can also populate dropdown or radio type field values:
Here we passed Query Type as Support Request
Multiple values for a single field (Multi-Select and Checkbox ) can be passed by appending |
That’s it! Feel free to contact us if we have any questions or suggestions.