I am having a form in my page and I am using the validation jquery plugin from here http://jqueryvalidation.org/
My form is:
<form action="sendform.action" id="myform" method="post" name="myform">
<fieldset>
<label>Name:*</label>
<input id="cname" name="cname" type="text" value="" required/>
</fieldset>
<fieldset>
<label>Email:*</label>
<input id="cmail" name="cmail" type="text" value="" required/>
</fieldset>
<fieldset>
<label>Phone:*</label>
<input id="cphone" name="cphone" type="text" value="" required/>
</fieldset>
<div class="submit-button">
<a href="#">Send</a>
</div>
</form>
and my javascript:
$(".submit-button").click(function(){
/*$("#myform").valid();*/
$("#myform").validate({
rules: {
cphone: {
required: true,
number: true
}
},
submitHandler: function(form) {
$(this).submit();
}
});
});
The problem is that this thing is not working. I am not getting any error logs so I do not know what is wrong. Also if I use $("#myform").valid(); instead it works. So is only the .validate() that is not working. Anyone had an idea? Thanks in advance