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.