implement jquery Plugin add method Validation
- by Eyla
I have a problem to use jquery Plugin/Validation.
I want to add a method and follow the documentation but I think I still missing some thing.
First I add the method but I think I have a problem to implement it.
please check my code and advice me.
<script src="js/jquery-1.4.1.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
jQuery.validator.addMethod("domain", function(value, element) {
return this.optional(element) || /^http:\/\/yahoo.com/.test(value);
}, "Please specify the correct domain for your documents");
$("#aspForm").validate();
});
<asp:TextBox ID="TextBox1" runat="server" CssClass="domain" ></asp:TextBox>
</script>