If you have a contact form on your website you can attach LiveCall to it so that anytime someone fills in the form and provides their phone number, LiveCall will automatically dispatch a call connecting you with this user. There are two ways you can do that:

Method 1: HTML Attribute
When you add the following attribute to the phone input element in your form: data-livecall-role="callback-phone-number-input", we will observe the form's submit event and automatically submit the callback to our servers.
The resulting input should look similarly to this:
<input type="tel" name="phone-number" data-livecall-role="callback-phone-number-input" />
However this solution might not always be ideal. If you're form is handled by some JavaScript code, of if you have validation and don't want to submit the callback before you're sure that the data in the form is valid, you should consider the second method.

Method 2: JavaScript
If your form is handled by JavaScript or it needs to be validated before submitting the callback, you should integrate the form using JavaScript. To do that, when you're ready to submit the form, call the livecallClient.submitCallback() method. Like this:
Replace the $("input[name=phone-number]").val() part with an appropriate code for retrieving the phone number from your form.
Was this article helpful?
Thank you!