How to prefill fields

User experience is critical to your form conversions. With Kali Forms you can improve the submission process by requesting the minimum number of fields from your users. This is done by prefilling form fields with information that is already available.

You can prefill fields using URL parameters, the syntax is:

For example if you are using the basic contact form available in the plugin at the following page:

… and you want to prefill the name field you only need to add ?name=John%20Doe to the URL:

If you are wondering what the %20 represents, this is the encoded version of an empty space. Since you cannot add spaces or other special characters in your URL, you must encode these characters using a percent sign and the hexadecimal value assigned to the character in the ISO-Latin character set. A space is assigned number 32, which is 20 in hexadecimal.

This can also be applied for dropdowns, radio and checkbox fields, the only difference is when you want to select multiple options in a checkbox field. In this case the syntax is a little different:[]=first-value&checkbox-group[]=second-value

The first parameter that you add to your URL needs to use ? while the rest of your parameters will use &.

Another method for prefilling fields is through additional parameters in the Kali Forms shortcode. The basic syntax of the shortcode is:

kaliform id=”your-form-id”

… in order to automatically prefill your form fields you will need to add extra parameters with the desired value. You will need to use the actual field names as the parameters.

kaliform id=”your-form-id” first-name=”John” last-name=”Doe”

For multiple choice fields you will need to set each value separated by a comma:

kaliform id=”your-form-id” first-name=”John” last-name=”Doe” checkbox-group=”first-value,second-value”

Was this article helpful to you? Yes No

Still stuck? We’re here to help.

Send us a message and we’ll get back to you as soon as we can.