<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I suggest you do something like this:<DIV><BR class="khtml-block-placeholder"></DIV><DIV>replace:</DIV><DIV>    if (inputFields[i].getAttribute("name") == <SPAN class="845441112-26092005"><FONT class="Apple-style-span" color="#000000"><SPAN class="Apple-style-span" style="background-color: transparent;">"products_id[][products_quantity]"</SPAN></FONT>) {</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="845441112-26092005">with:</SPAN></DIV><DIV><SPAN class="845441112-26092005">    if (inputFields[i].getAttribute("name").substring(0,11) == "products_id") {</SPAN></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="845441112-26092005">This will scan for fields where the attribute "name" starts with "products_id".<BR></SPAN><DIV> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Julien Nadeau</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><A href="mailto:junado@junado.com">junado@junado.com</A></FONT></P>  </DIV><BR><DIV><DIV>Le 05-09-26 à 08:14, Michael Borchers a écrit :</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">&gt; </FONT></SPAN></DIV> <DIV><SPAN class="845441112-26092005"> </SPAN>function countRows() {</DIV> <BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px">  <DIV>    var orderNumRows = 0;</DIV>  <DIV>    var inputFields =   document.getElementsByTagName("input")</DIV>  <DIV>    var numTag = inputFields.length;</DIV>  <DIV>    for (i=0; i&lt;numTag; i++) {</DIV>  <DIV>        if (inputFields[i].getAttribute("name") ==   "test[]") {</DIV>  <DIV>            orderNumRows++;</DIV>  <DIV>        }</DIV>  <DIV>    }</DIV>  <DIV>    </DIV>  <DIV>    alert(orderNumRows);</DIV>  <DIV>}<SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"> </FONT></SPAN></DIV>  <DIV><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT> </DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">&lt;&lt;&lt;</FONT></SPAN></DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT></SPAN> </DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">ok, now my input's name is products_id[X][products_quantity], while X   is the position in array.</FONT></SPAN></DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">regarding your function mine should look like this,   or?</FONT></SPAN></DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT></SPAN> </DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">function countRows() {<BR>    var ordersNumRows =   0;<BR>    var inputFields =   document.getElementsByTagName("input")<BR>    var numTag =   inputFields.length;<BR>    for (i=0; i&lt;numTag; i++)   {<BR>        if   (inputFields[i].getAttribute("name") == "products_id[][products_quantity]")   {<BR>              ordersNumRows++;<BR>          }<BR>    }<BR>    <BR>      alert(ordersNumRows);<BR>}</FONT></SPAN></DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT></SPAN> </DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">or do i need to add the X within "products_id[" + i +   "][products_quantity]"?</FONT></SPAN></DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT></SPAN> </DIV>  <DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2">and how can i make it work for selects? just change   document.getElementsByTagName("select")?</FONT></SPAN></DIV><SPAN class="845441112-26092005"><FONT face="Trebuchet MS" color="#0000ff" size="2"></FONT></SPAN></BLOCKQUOTE> <BLOCKQUOTE dir="ltr" style="MARGIN-RIGHT: 0px"><SPAN class="845441112-26092005"><FONT>  <DIV><SPAN class="845441112-26092005"></SPAN><FONT face="Trebuchet MS" color="#0000ff" size="2">t<SPAN class="845441112-26092005">hanks! </SPAN><BR></FONT></DIV></FONT></SPAN></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Javascript mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://lists.LaTech.edu/mailman/listinfo/javascript">https://lists.LaTech.edu/mailman/listinfo/javascript</A></DIV> <BR class="Apple-interchange-newline"></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>