Checkboxes (LONG): Handling multiple rows

From: Date: Thu, 06 Jul 2000 02:22:41 +0000
Subject: Checkboxes (LONG): Handling multiple rows
Groups: php.dev 
Request: Send a blank email to php-dev+get-23650@lists.php.net to get a copy of this message
Hello, I have a table with checkboxes down the first column. Each checkbox row has a series of hidden values (interspersed with displayed values) that are needed by the next page. The challenge has been that if I have, for example, 6 checkable rows, and the user checks rows 1,3 & 4, I would like the next page to handle just those rows. Instead, the results are inconsistent. The html (generated by PHP) looks like this: <bla bla bla><form method="post" action="file.php"> <input type="CHECKBOX" name="new_pcr[]" value="on"> <input type="hidden" name="dna_source[]" value="'.$dna_source.'"> <input type="hidden" name="forward_primer[]" value="'.$forward_primer.'"> <input type="hidden" name="reverse_primer[]" value="'.$reverse_primer.'"> </bla bla bla></form> In fact, if I go to the next page with NO rows checked, PHP processes the 1st row anyway! So then I tried this technique: $array_size = count($new_pcr); // is this counting ALL arrayed hidden info, or just the CHECKED boxes? for ($count=0; $array_size>=$count; $count++) { echo $count.' '.$new_pcr[$count]."<br>"; } If I check boxes 1, 3 & 5, I then get a response of 0 on 1 on 2 on Also, I can check just one row, and get mixed results. I may check the 3rd row and the 1st row's values come across in the array. This is confusing! Thank you for your help, -- Paul Fernandez Webmaster Structural GenomiX, Inc.

« previous php.dev (#23650) next »