This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a javascript code to pass value to the form filed using "document.getElementById("id").innerHTML", but I did not know where to put the "ID" in the HTML code(cred_field).
HTML code
[cred_field field='id-number1' force_type='field' class='form-control' output='bootstrap']
javascriptcode:
var c= document.getElementById("id").innerHTML="567865e";
It somewhat depends on the kind of field input how you would achieve this.
Most fields can take a default value, which may be one way to set the value for a field.
If the field is a regular input (rather than checkboxes or a select dropdown with options, for example) then you can use the browser dev tools to inspect the input on the front-end and identify a specific selector for that field that you can use to target it with JavaScript, e.g. the name attribute will likely be the slug of the custom field with a 'wpcf-' prefix.
Also, you would probably set the value attribute rather than the innerHTML.
Rather than using document.getElementById (where you need an ID) you can use document.querySelector to target the input based upon the name attribute, e.g.