Henri Marc wrote:

<td style="vertical-align: top;">1<input
name="grid[1][1]" value="1" type="checkbox"><br>
              </td>
[snip]
<td style="vertical-align: top;">1<input
name="grid[2][1]" value="1" type="checkbox"><br>
              </td>

Is there a reason you're sending a 1, 2 or 3 value with the checkboxes? You already know what was checked by the keys of the $grid array. I'd leave it similar to how you have it, but just pass 1 for every value (since you won't be needing it). You can create your grid like this:


<td style="vertical-align: top;">1<input name="grid[1][1]" value="1" type="checkbox"<?php if(isset($grid[1][1])){echo ' checked';}?>><br></td>

<td style="vertical-align: top;">2<input name="grid[2][2]" value="1" type="checkbox"<?php if(isset($grid[2][2])){echo ' checked';}?>><br></td>

etc...

That'll "remember" what boxes were checked when the grid is redisplayed, also.

--

John Holmes

php|architect - The magazine for PHP professionals - http://www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to