I am using a jQuery plugin that works with the name attributes of form elements. I know that I can access the id attribute value using:
"<%= myControl.ClientID %>"
What about the name attribute? In the html source, I see that the name and identifier are different from each other.
Thanks PaweΕ
EDIT:
Full code:
$("form").validate({ rules: { "<%= _FullNameTextbox.ClientID %>": { required: true, minlength: 2 }, "<%= _EmailAddressTextbox.ClientID %>": { required: true, email: true } }, messages: { "<%= _FullNameTextbox.ClientID %>": { required: "Please enter your full name", minlength: "Your name must consist of at least two characters" }, "<%= _EmailAddressTextbox.ClientID %>": { required: "Please enter a valid email address", email: "Please enter a valid email address" } } });
It worked fine when the control was on the page. But now that I have placed it inside the user control, id and name are different:
<input type="text" id="Container__EmailAddressTextbox" name="Container$_EmailAddressTextbox" class="error">
So instead of using _FullNameTextbox.ClientID, I need to access the value of the name attribute
dragonfly
source share