Re: array of checkbox values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sjef Janssen wrote:

> I have a form with a number of checkboxes grouped together. The value of
> these boxes is stored in an array: $used[]. Now I found that the value of
> checked boxes (value = 'Y') are stored in the array while non checked
> boxes are not stored at all. This makes the array incomplete as I want to
> have all checkbox values in the array.

That's how HTML forms work. The general solution is to set the value of the
checkbox to describe what the checkbox is (for example, the row id of the
database record that the checkbox is associated with). Then you can loop
through and see which values were submitted.

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux