If you just want a client side validation, why don't you just simply validate using HTML regular expression as follows: If you just want a client side validation, why don't you just simply validate using HTML regular expression as follows:
<form action="">
<p>
<h2> Contact Info...</h2>
<pre>
Last Name : <input type="text" name="name2" size="20">
Email : <input type="email" id = "custEmail" size="30" pattern="[^@]+@[^@]+\.[a-zA-Z]{2,6}">
Mobile number : <input type="text" name="mob" size="15">
</pre>
<input type = "reset" id = "reset" />
<input type = "submit" id = "submit" />
</form>
See fiddle here: http://jsfiddle.net/9gthN/