ODBiC Discussion Board

RE: Solving the checkbox issue, Louis van Eijk, 08-20-2002

What I do...

by Roger Harris
August 24, 2002 00:52

What I do is give the checkboxes sequentially numbered names. If you're displaying database query results, for example, you can use something like <input name="checkbox$row$" ...> so you have inputs named "checkbox1", "checkbox2", etc. Then, in the template that processes the form input with an EACHMULTI loop, you don't include the "checkbox" variable in the EACHMULTI list variables -- just the other input variables from the result row. But then, for each row, you can test the value of the checkbox for that row by using $var(checkbox$multirow$). For example, the third row of the database results will have an input named "checkbox3". If that is the first box checked on the page, then as the EACHMULTI loop goes through the inputs (which are numbered by the $multirow$ variable), "checkbox1" and "checkbox2" will be undefined, but then "checkbox3" will have whatever value you defined for that <input>.


Post Your Reply:

E-mail  optional

HTTP Link: 
Link text: 

Copyright ©1997, Roger Harris. All rights reserved.