This is my sample code and am trying to checking the emptiness of the text box by user query but Jquery validation is not raising when am using the contentplaceholder,can any one check and tell me???
jQuery.validator.setDefaults({
debug: true,
success: "valid"
}); ;
$(document).ready(function() {
$("#form1").validate({
rules: {
<%=txtUserName.UniqueID %>: {minlength: 5,required: true},
<%=txtPassword.UniqueID %>: {minlength: 5,required: true},
<%=txtEmail.UniqueID %>: {required: true},
<%=txtURL.UniqueID %>: {required: true}
}, messages: {
<%=txtUserName.UniqueID %>:{required: "Plaese enter your name",minlength: "User name must be atleaet of 5 characters"},
<%=txtPassword.UniqueID %>:{required: "Plaese enter your password", minlength: "Password must be atleaet of 5 characters"},
<%=txtEmail.UniqueID %>:{ required: "Plaese enter your Email Id",},
<%=txtURL.UniqueID %>:{ required: "Plaese enter Website URL",}
}
});
});
Validation Example using JQuery | |
User Name : | |
Password : | |
Email Id : | |
URL : | |
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek YadavPosted Feb 18, 2015, 3:21 PM
I've updated your code and it executed successfully with proper output.
But I think there's some issue with your jQuery plugin which you're using in your web page. When I run your above code, I got bellow mentioned errors:
1. System.Web.HttpException: A page can have only one server-side Form tag. (To resolve this error, remove