[snip]
Pablo Gosse wrote:
> [snip]
> If the elements all live within the same form, you can add [] to the
>    end of the name/id attribute, and then all checkboxes with the
> same name will be accessible in an array.  So "checkboxname[]" will
> show up as $_POST['checkboxname'] on the receiving end. [/snip]
Todd Cary wrote:
> Can I do $MyArray = $_POST['checkboxname'];   
> 
> And then access each array element
>    for ($i = 0; $i < (count($MyAray)); $i++) echo $MyArray[$i];
> 
> Todd
[/snip]

Yes, that should work fine.  But remember the caveat that all elements
using the [] notation must be in the same form.

If you've got multiple forms on the page and expect to get all
checkboxname values it will not happen using [].  You'll need to use JS
for that.

Pablo. 

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

Reply via email to