[PHP] Re: array of checkbox values

2006-01-12 Thread Sjef
Interesting way to solve the problem. I thought about checking whether the keys are present (if not the checkbox is set to "N".) I wil definitily try this option as well. Thxs all! Sjef "Al" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Sjef Janssen wrote: >> Hallo, >> I have a

[PHP] Re: array of checkbox values

2006-01-11 Thread Al
Sjef Janssen wrote: Hallo, 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 inc

[PHP] Re: array of checkbox values

2006-01-11 Thread James Benson
Do something like: $checkboxes = array('food','drink','smoking'); // display the checkboxes foreach($checkboxes as $checkbox) { echo "$checkbox: "; } Then when processing the form input check if each of the $checkboxes array values are present, if not, you can set to something else s

Re: [PHP] Re: array of checkbox values

2006-01-11 Thread Philip Hallstrom
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Nope. That's the problem. If a checkbox is unchecked the browser do

[PHP] Re: array of checkbox values

2006-01-11 Thread Sjef
Would it be enough to set a key for each checkbox, for example explicitly say: checkbox[1] checkbox[2] checkbox[3] then a non checked box will have an empty string as a value, whereas the checked ones will have a value of 'Y'. Sjef "David Dorward" <[EMAIL PROTECTED]> schreef in bericht news:[E

[PHP] Re: array of checkbox values

2006-01-11 Thread David Dorward
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 inc