Table of Content

    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(){ … });

      MethodDescription
      setNameset Visitor Name
      setEmailset visitor email address
      setContactset visitor contact no
      setSubjectset subject of offline message
      setMessageset 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]

      AUTHOR’S BIO

      Mohaimin Talha is a seasoned Product Manager, known for his ability to combine creativity with analytical thinking. His strategic vision and customer-centric approach make him a key driver of product success and business growth.

      0:00 / 0:00