A very simple way is to place a hidden field that places the <@NUMROWS> of the array that is populating the table and then you can query that value from javascript.
Ben Johansen - http://www.pcforge.com Authorized Witango & MDaemon Reseller Available for Witango Developement -----Original Message----- From: Witango [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 10:56 AM To: [EMAIL PROTECTED] Subject: Witango-Talk: Dynamically Adding Rows I'm trying to write a javascript function for one of my Results pages to add input text fields and place the result in another text field. My problem is doing this for a variable number of rows on a given page. Here's a simplified version of my implementation that only works in Netscape/Mozilla right now. Any ideas how to get this to work in all browsers? Thanks. Matthew. <script language="JavaScript"> function add(form, i) { form.eval("total"+i).value = (form.eval("x"+i).value-0) + (form.eval("y"+i).value-0) } </script> <form> <table> <@rows> <tr> <td><input name="x<@currow>" type="text" onChange="add(this.form,<@currow>"></td> <td><input name="y<@currow>" type="text" onChange="add(this.form,<@currow>"></td> <td><input readonly name="total<@currow>" type="text"></td> </tr> </@rows> </table> </form> I also tried the following variation of the function but that doesn't work either. function add(form, i) { eval("form.total"+i+".value") = (eval("form.x"+i+".value")-0) + (eval("form.y"+i+".value")-0) } ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf ________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
