Adding Custom Fields to the Chat Widget Contact Form
Enhancing Your Chat Contact Form
You can now add custom fields to the contact form used in your SMS/Email and WhatsApp chat widgets. This feature allows you to collect specific information from your visitors beyond the standard details, tailoring the data capture to your business needs.
Standard and Custom Fields
The chat widget includes several standard fields by default. The Name field is always required. You must also collect either a Phone number or an Email address (the form defaults to Phone if you try to remove both). A Message field is also supported.
In addition to these, you can add custom fields. The available data types for custom fields are:
- SINGLE LINE
- MULTI LINE
- MONETARY
- NUMERIC
- PHONE
- DATE PICKER
- DROPDOWN (SINGLE)
Field Limits and Requirements
The total number of fields in the contact form, including both standard and custom fields, cannot exceed five.
Standard fields (Name, Phone, Email, and Message) are mandatory when they are present in the form. For custom fields, you can choose to mark them as required. A red asterisk (*) will appear next to the label of any required field. A visitor must complete all required fields before they can submit the form.
This requirement is enforced in two scenarios:
- When a visitor initiates a new conversation using the widget's contact form.
- When an agent manually requests contact details during an active chat.
Field Validation
The system automatically validates input for specific field types:
- Phone fields are validated based on the selected country code.
- Email fields are checked for the correct format.
Please note: Any existing chat widgets you have published will continue to function as before unless you edit them and specifically mark fields as required.
International Phone Number Support
If your form contains two or more phone number fields, the widget will display a country code selector to help with international number formatting. However, you can only select one country code for the entire form. If you change the country flag for one phone field, it will automatically update the flag for all other phone fields in the form.