Skip to main content

Populate Custom Fields and capture in submission using Custom HTML/Javascript Logic

Updated over 6 months ago

Automatically populating a custom field in forms or surveys using custom HTML or JavaScript, and then saving it during submission, is a simple process.

Retrieve the Custom Field ID:

- Go to the Preview of the form.

- Right-click on the page and select 'Inspect.'

- Select the mouse pointer tool.

- Click on the "Custom Field."

- Copy the ID from the name and ID properties.

Example:

If you created a custom field named `xxTrustedFormCertUrl`, follow the above steps to get its ID.

Note: myData is just for example. In the customer's custom HTML/Javascript code. Customers have to figure it out where is the captured data and replace the myData

document.getElementsByName('customFieldId')[0].value = myData; document.getElementsByName('customFieldId')[0].dispatchEvent(new Event("input"));

Did this answer your question?