Table of Contents

AfterOffice Form-To-Mail Template with Captcha Support

Version: 1.5

This form can be used by AfterOffice customers to create contact or feedback form on their website, which will send all collected information to the target email address.

Important Notes:


Form Action

The form action looks like below.

<FORM action="http://vo.yourdomain.com/cgi-bin/vo/formmail.cgi.vo" method="post">

Where yourdomain.com: Your domain.


Fields

Press refer to this page for all supported fields: https://afteroffice.com/form/form-captcha.html


Captcha Support

In order to load and display captcha, you are required to insert the following javascript function into your html header.

<script language="javascript">
   $(document).ready(function(){
      $('#hv').load('/cgi-bin/vo/form_hv.cgi.vo');
   });
</script>

To display the captcha field, simply insert into your form.

Your Name: <input type="name" id="name" name="name" required>
Your Email: <input type="email" id="email" name="email" required>
<span id="hv"></span>
<input type="submit" value="Send Message">

Captcha Validation (Optional)

The following javascript function is used to check if captcha is filled when the form is submitted. If the captcha is not filled, the user will be alerted.

<script>
   function validateForm()
   {
      var x=document.forms["formName"]["_hv"].value;
      if (x==null || x=="")
      {
         alert("Please fill in captcha");
         return false;
      }
   }
</script>

Where formName represents the name of the form.

This function can be inserted as the onsubmit event of the form, like the example below.

<FORM action="http://vo.yourdomain.com/cgi-bin/vo/formmail.cgi.vo" method="post" id="formName" name="formName" onsubmit="return validateForm() />

Samples

https://afteroffice.com/form/sample/sample_enquiry_captcha.html