Skip to content
Sites

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

Auto populating the existing custom field in forms / Survey using custom HTML/Javscript and later saved in submisison is simple and straightforward…

1 min read114 words1 explained imageUpdated Wed, 7 Aug, 2024 at 7:11 AM
View as markdownOpen in ClaudeOpen in ChatGPT
Each image has a one line explanation. Switch to full detail for the step it belongs to, the fields and buttons involved, examples and the whole procedure.
Auto populating the existing custom field in forms / Survey using custom HTML/Javscript and later saved in submisison is simple and straightforward. 
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.
Figure 1 What this shows If you created a custom field named `xxTrustedFormCertUrl`, follow the above steps to get its ID. What this shows Illustrates "Populate Custom Fields and capture in submission using Custom HTML/Javascript Logic". This screenshot appears in "Populate Custom Fields and capture in submission using Custom HTML/Javascript Logic". The text alongside this image reads: If you created a custom field named `xxTrustedFormCertUrl`, follow the above steps to get its ID. Immediately after, the guide continues: Note: myData is just for example. In the customer custom HTML/Javascript code. Customer have to figure it out where is the captured data and replace the myData. Image 1 of 1 What this coversIf you created a custom field named `xxTrustedFormCertUrl`, follow the above steps to get its ID.
Buttons and menus referenced myData
Next stepNote: myData is just for example. In the customer custom HTML/Javascript code. Customer have to figure it out where is the captured data and replace the myData
Note:  myData  is just for example. In the customer custom HTML/Javascript code. Customer 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"));

Was this guide helpful?

Related guides