I would really like to use the jQuery Validation plugin in an ASP.NET Web Forms application (not MVC). Itβs easier for me than adding asp validators everywhere, and setting up a control to check the fields on all of them.
I am having some problems installing a class, such as class = "required email address", which, it seems to me, is related to the form tag in the main form tag.
I also run into problems when calling jquery validation using names that get crippled in asp control
// validate signup form on keyup and submit $("#signupForm").validate({ rules: { username: { required: true, minlength: 2 }, }, messages: { username: { required: "Please enter a username", minlength: "username at least 2 characters" }, }. ....... <p> <label for="username"> Username</label> <input id="username" name="username" /> </p>
because this one
<asp:TextBox ID="tbUsername" runat="server"></asp:TextBox>
displayed as
<input name="ctl00$ContentPlaceHolder1$tbUsername" type="text" id="ctl00_ContentPlaceHolder1_tbUsername" />
and changes the name. I can get ClientID using <%=tbUsername.ClientID %> , but this does not work with ClientName
Has anyone had success using the jquery validation plugin with asp.net? If so, what about using multiple forms similar to individual validation groups?
eiu165 Mar 06 '09 at 18:01 2009-03-06 18:01
source share