Form fields & selectors
Field names the handler expects
The hosted contact handler recognizes these field names:
name— requiredphone— requiredemail— requiredmessage— requiredreason— optional
Any additional named inputs you include are forwarded along with the submission,
so you can capture extra context without extra configuration. An empty optional
reason is omitted automatically.
Targeting your form
By default the client binds to any form carrying the data-contact-form
attribute:
<form data-contact-form>
<!-- fields -->
</form>
If your markup already uses its own classes or IDs, pass a custom selector
instead:
<form class="marketing-contact-form">
<!-- fields -->
</form>
<script src="https://script.app.overtureforms.com/contact-form.bundle.js" defer></script>
<script>
window.addEventListener("DOMContentLoaded", function () {
window.ContactFormHandler.initContactForms({
selector: ".marketing-contact-form",
publicKey: "YOUR_PUBLIC_KEY",
formId: "YOUR_FORM_ID"
});
});
</script>
Migrating an existing form
If your form currently submits to a page URL (action="#" or a server route),
let the Overture client take over submit handling reliably:
- Load the bundle with
defer. - Call
initContactForms(...)onDOMContentLoaded. - Keep
data-contact-form(or passselector) on the form element.
No other changes are needed — the client intercepts the submit event, so your
existing action is ignored.