HTML code for "Contact Us" extended form

This is an extension of our "Contact Us" form. Use it when you need to gather more information from your visitor.

Click here to see how your form will look like

The form is completely customizable!
JavaScript validates required fields; plus there is a verification on the server-side.
Captcha image protects the form against SPAM.
Captcha image can be reloaded.
There are many styles of Captcha image available.


This is ProCaptcha code. Free BasicCaptcha code is here.

How to use ProCaptcha code

1. Create an account if you have not done it yet.

2. Copy and paste the code below into your webpage.

3. Specify a form in your profile with SnapHostID W75ZQU97TCHR.


<h2>Contact Us</h2>
<form action="http://www.SnapHost.com/captcha/WebFormSubmit.aspx" id="ContactUsCaptchaWebForm" method="post" onsubmit="return ValidateForm(this);">
<input id="SnapHostID" name="SnapHostID" type="hidden" value="W75ZQU97TCHR" />
<script type="text/javascript">
function ValidateForm(frm) {
if (frm.FirstName.value == "") {alert('First name is required.');frm.FirstName.focus();return false;}
if (frm.LastName.value == "") {alert('Last name is required.');frm.LastName.focus();return false;}
if (frm.FromEmailAddress.value == "") {alert('Email address is required.');frm.FromEmailAddress.focus();return false;}
if (frm.FromEmailAddress.value.indexOf("@") < 1 || frm.FromEmailAddress.value.indexOf(".") < 1) {alert('Please enter a valid email address.');frm.FromEmailAddress.focus();return false;}
if (frm.Comments.value == "") {alert('Please enter comments or questions.');frm.Comments.focus();return false;}
if (frm.CaptchaCode.value == "") {alert('Enter web form code.');frm.CaptchaCode.focus();return false;}
return true; }
function ReloadCaptchaImage(captchaImageId) {
var obj = document.getElementById(captchaImageId);
var src = obj.src;
var date = new Date();
var pos = src.indexOf('&rad=');
if (pos >= 0) { src = src.substr(0, pos); }
obj.src = src + '&rad=' + date.getTime();
return false; }
</script>
<table border="0" cellpadding="5" cellspacing="0" width="520">
<tr><td style="width:50%">First name*:<br />
<input id="FirstName" name="FirstName" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td style="width:50%">Last name*:<br />
<input id="LastName" name="LastName" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
</tr><tr>
<td>Email address*:<br />
<input id="FromEmailAddress" name="FromEmailAddress" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td>&nbsp;</td>
</tr><tr>
<td>Work phone number:<br />
<input id="WorkPhoneNumber" name="WorkPhoneNumber" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td>Fax number:<br />
<input id="FaxNumber" name="FaxNumber" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
</tr><tr>
<td>Home phone number:<br />
<input id="HomePhoneNumber" name="HomePhoneNumber" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td>Mobile phone number:<br />
<input id="MobilePhoneNumber" name="MobilePhoneNumber" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
</tr><tr>
<td colspan="2">Address:<br />
<input id="Address" name="Address" type="text" maxlength="250" style="width:500px; border:1px solid #009900" /></td>
</tr><tr>
<td>City:<br />
<input id="City" name="City" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td>State / Province / Region:<br />
<input id="State" name="State" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
</tr><tr>
<td>Country:<br />
<input id="Country" name="Country" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
<td>ZIP / Postal code:<br />
<input id="Zip" name="Zip" type="text" maxlength="60" style="width:240px; border:1px solid #009900" /></td>
</tr><tr>
<td colspan="2">Comments and questions*:<br />
<textarea name="Comments" id="Comments" rows="7" cols="40" style="width:500px; border:1px solid #009900"></textarea></td>
</tr><tr>
<td colspan="2" align="center"> <br />
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td> <i>Enter web form code*:</i>
<input id="CaptchaCode" name="CaptchaCode" type="text" style="width:80px; border:1px solid #999999" maxlength="6" />
</td><td>
<a href="http://www.SnapHost.com"><img id="CaptchaImage" alt="Web Form Code" title="Anti-spam web forms"
style="margin-left:20px; border:1px solid #999999;"
src="http://www.SnapHost.com/captcha/WebForm.aspx?id=W75ZQU97TCHR&ImgType=2" /></a><br />
<a href="#" onclick="return ReloadCaptchaImage('CaptchaImage');"><span style="font-size:12px;">reload image</span></a> </td></tr>
</table> <br />
* - required fields. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<input id="skip_Submit" name="skip_Submit" type="submit" value="Submit" />
</td></tr>
</table><br />
</form>