Client-side custom forms in the chat widget
Register a form from your own page code and show it in the chat, so customers can enter structured details without leaving the conversation.
Some details are easier to enter in a form than in a sentence: an order number, a shipping address, a date. You can now register a form in your page code and show it inside the chat.
What you can do
- Define a form in JavaScript with
window.askocto.registerForm(name, config) - Describe the fields in the config: labels, input types and which ones are required
- Show the form in the conversation when the agent needs the details
- Receive the submitted values in your own code, so they can go to your systems
How it fits together
Your page registers the form under a name. A procedure tells the agent when to ask for it, for example: when the customer wants to change a delivery address, show the address form. The customer fills it in without leaving the chat, and the agent carries on with the values.
The form lives in your code, so the labels, validation and submission follow your site. Nothing sits on the Askocto side except the name that connects it to the conversation.
Try it
- Add the embed script to a test page.
- Register a form before the widget opens.
- Open the agent and go to Build > Procedures to name the form where it should appear.
- Chat with the agent on the test page and check the form and the result.
Customers who are signed in can be identified with identify, so the form can be prefilled with what you already know.
Read the custom forms guide and the custom actions guide.
See every update in one place.