To set the Default Values, copy & paste the Form embed code and find the line with the key: ‘height‘. Below this line add the next code to populate a text field with the ID: ‘text_0’.
'defaultValues': { 'text_0': 'This is my default value' }
Note: You can find the field ID in Form Builder -> Code tab.
See the example below to understand how to set the Default Values object.
var s = d.createElement(t), options = { 'id': 1, 'container': 'c1', 'height': '500px', 'defaultValues': { 'text_0': 'This is my default value', 'checkbox_0': true, 'select_0': 'Second Option' } 'form': '//example.com/app/embed' };
How to pass PHP variables to the Form Widget
For this tip, you need to add an embed code to a PHP webpage, then you need to customize the embed code to add the defaultValues object and print the PHP variables. Eg.
'defaultValues': { 'text_0': '<?= $_GET['lname'] ?>' }