Category / Section
Embeddable Web Form APIs
Published:
The Embeddable Web Form APIs allow you to pre-fill all the fields in the Contact Us form.
Prefill Form Fields
To fill out the form, simply use the Prefill API. For dropdown type (single or multi-select), assign the id as the value. For other fields, simply assign a string value.
BolddeskWidget (fill, form, {
name: 'Daniel',
emailId: 'daniel@afgc.inc',
categoryId: 12,
cf_country: 21,
cf_state: 17
});
Open a article
You can use this API to open a article when your customers click on a link on your website. When using this API, you need to provide the article ID.
BolddeskWidget('open', 'article', {
id: 123 // article ID
});
Onload Customization
Add the following script above the embedded code to pre-fill the form fields when the page loads.
<script>
window.BolddeskWidgetConfig = {
form: {
fill: { name: "Daniel", emailId: "'daniel@afgc.inc'", categoryId: 12 }
},
created: (args) => {
// When the web form is rendered, the created event will be triggered.
}
}
</script>
When a Web Form is rendered, the created event will be triggered. The following properties can be found in the created event argument.
{
type: form,
id: Web form Id,
name: Web form Name
}