Pre-Chat Form Script
- July 21, 2025
- 1 mins read
Table of Content
Using this API Developer can set Online Pre Chat form data. Such as user name, email and contact number.
API call should be placed always bellow the REVE Chat script and Wrapped within, learn more on how to call this.
$_REVECHAT_API(function(){ … });
Method | Description |
---|---|
setName | set Visitor Name |
setEmail | set visitor email address |
setContact | set visitor contact no |
setSubject | set subject of offline message |
setMessage | set predefined offline message |
Setting Pre-Chat Form Data
function setName(name)
set the visitor name.
function setEmail(email)
set the visitor email address.
function setContact(contact)
set the visitor contact number.
How to Run Code
SetFormInfo
<script type="text/javascript">
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.setFormInfo('name', 'email', 'phoneNo');
});
</script>
SetName
<script type="text/javascript">
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.setName('john');
});
</script>
SetEmail
<script type="text/javascript">
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.setEmail('[email protected]');
});
</script>
SetContact
<script type="text/javascript">
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.setContact('+8801811412833');
});
</script>
Enable/Disable Pre-Chat Form
- Insert chat script into website first
- Insert following html code into your website as needed
Enable pre-chat form when visitor is not logged in
Paste following code snippet into webpage
Enable pre-chat form
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.enableOrDisableForm(true);
});
</script>
Disable pre-chat form when visitor is logged in
Paste following code snippet into webpage
Disable pre-chat form
$_REVECHAT_API(function()
{
$_REVECHAT_API.Form.Online.enableOrDisableForm(false);
});
Any questions? Please email us at [email protected]