How to prefill fields when embedding a form?

If you want to prefill form fields when embedding your form on a webpage, you can do that by tweaking and using the code provided below. We’ll see in a second how to use it. First, let’s mention that, when sharing the form link or publishing the form on WordPress, the procedure is different.
Read more about how to prefill form fields when sharing the form link.
Back to the code needed when embedding the form on a regular web page, what you need to do is copy the following code, paste it in your web page, and make the adjustments indicated in below the code.

prefill embedded form ></p>
<div class=
There are three areas in which you need to focus:

  • The function data-custom-vars is not added by default in the javascript code you have obtained in PublishEmbed Code. Therefore, you’ll need to add it manually to your code, followed by the ids of your form fields you want prefilled with the desired values.
  • Following, control7561033-1=John means that the field with the name control7561033-1 has John as the prefilled value. The field with the name control7561033-2 is prefilled with the value Doe, and so on. Field – value pairs are linked through the operator &. To identify form field names, inspect the form code using a browser inspection tool.

Now save the code and preview the result. The code above looks like this: