jquery - getting controls inside a repeater in javascript function for validation -
jquery - getting controls inside a repeater in javascript function for validation -
i set several controls within repeater command id = "rpcontacts". repeater placed within table id = "parenttable". need validate command within repeater(say text box- txtlastname) duplicate value value within text box outside repeater. validation function called custom validator outside repeater.
the problem not client id of neither repeater nor controls within in javascript function.
i values of controls within repeater if give rendered clientid like
$find('ctl00_body_content_rpcontacts_ctl00_txtlastname').value;
but client id of command wil alter each row of repeater.
ie. txtzip in 2nd repeater row id 'ctl00_body_content_rpcontacts_ctl01_txtlastname'.
any suggestions how can validation.
validate controls way:
$find('.rpcontacts').value;
//your javascript code var elemarray = document.getelementsbyclassname('rpcontacts'); for(var = 0; < elemarray.length; i++){ var elem = elemarray[i].value; } //your aspx code <asp:repeater id="repeater1" runat="server"> <itemtemplate> <asp:textbox id="txtlastname" runat="server" cssclass="rpcontacts"></asp:textbox> ....
javascript jquery asp.net vb.net
Comments
Post a Comment