[jQuery] Validate plugin with .asp.net
I can't use jquery's validate plugin in my asp.net 2.0 form. I made a
simple form like the following code
<script type="text/javascript">
$(function(){
$('#frmTest').validate({
rules:{
txtName:"required"
,txtComment:"required"
,txtEmail:"email"
}
,messages:{
txtName:"Just Add the first name"
,txtComment:"Add some comment"
,txtEmail:"Your email address must be in the format of
name@domain.com"
}
,submitHandler: function(){alert('Finaly submit it');}
});// validate
});//ready
</script>
For the the following html :
<form id="frmTest" name="frmTest" action="Handler/
Test_Handler.ashx" method="post">
<label for="txtName">Name:</label>
<input id="txtName" name="txtName" type="text" /><br />
<label for="txtEmail">Email:</label>
<input id="txtEmail" name="txtEmail" type="text" /><br />
<label for="txtComment">Comment:</label>
<textarea name="txtComment" id="txt_Comment" rows="5"
style="width: 400px"></textarea>
<br />
<input id="Submit1" type="submit" value="submit" />
</form>
The code runs flawlessly in a HTML file, but not in aspx file. In the
later it posts back to the same form. I really like this plugin, and
really wants to use it on my .net application. Is there any way to
cancel the post back in .net and force the code to use jquery's
plugin? Any help would be grealtly appreciated.