How can I access the similar asp control id's by using for loop? I have the following asp text boxes.
<asp:TextBox ID="PFtxtname1" runat="server"></asp:TextBox>
<asp:TextBox ID="PFtxtname2" runat="server"></asp:TextBox>
<asp:TextBox ID="PFtxtname3" runat="server"></asp:TextBox>
<asp:TextBox ID="PFtxtname4" runat="server"></asp:TextBox>
<asp:TextBox ID="PFtxtname5" runat="server"></asp:TextBox>
<asp:TextBox ID="PFtxtname6" runat="server"></asp:TextBox>
and I want to access all these text box value through for loop using jQuery, how can I do?
I am tried to get the value by below code, but it shows error.
var ar_val=[];
for(i=0;i<7;i++)
{
var txtv = $("#<%=PFtxtname"+i+".ClientID%>").val().trim();
ar_val.push(txtv);
}