Re: [PHP] array + checkbox
If( strcmp($voorraad[1],'on') == 0 ) // it's checked else // it's not Alternatively, fix your HTML by using quotes and a value attribute: INPUT TYPE=checkbox name=voorraad value=something checked Then: if ($voorraad=='something') { // checked } - Colin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array + checkbox
Hey Colin, You will need some javascript to handle the checkbox' onchange event because when the user clicks the checkbox off and back on, the value will be 'on' - and your if-condition will not work! Greetz, Bjorn Van Simaeys www.bvsenterprises.com --- Colin Viebrock [EMAIL PROTECTED] wrote: If( strcmp($voorraad[1],'on') == 0 ) // it's checked else // it's not Alternatively, fix your HTML by using quotes and a value attribute: INPUT TYPE=checkbox name=voorraad value=something checked Then: if ($voorraad=='something') { // checked } - Colin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array + checkbox
You will need some javascript to handle the checkbox' onchange event because when the user clicks the checkbox off and back on, the value will be 'on' - and your if-condition will not work! Uh, no. INPUT TYPE=checkbox name=voorraad value=something checked When you submit the form, $voorraad will either be something or , depending on whether it was checked or not. http://devel.easydns.com/~cmv/checkbox.php http://devel.easydns.com/~cmv/checkbox.phps (source) onChange stuff is only if you want to do Javascript processing client-side. - Colin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] array + checkbox
I've the following weird problem. I have a form which contains an array with values of some checkboxes. This is the HTML-part: INPUT TYPE=checkbox name=voorraad checked if checked or INPUT TYPE=checkbox name=voorraad Try INPUT TYPE=checkbox name=voorraad[] maybe...? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array + checkbox
Sorry, I've copied some old code. It was already INPUT TYPE=checkbox name=voorraad[] - Original Message - From: Jason Murray [EMAIL PROTECTED] To: 'Tijmen Hennink' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 06, 2001 10:37 AM Subject: RE: [PHP] array + checkbox I've the following weird problem. I have a form which contains an array with values of some checkboxes. This is the HTML-part: INPUT TYPE=checkbox name=voorraad checked if checked or INPUT TYPE=checkbox name=voorraad Try INPUT TYPE=checkbox name=voorraad[] maybe...? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array + checkbox
Some extra debuginfo. When I'm submitting a page where the checkbox is not set in the beginning and in same page an checkbox that is initially set to checked I can see that the first is not set and the second is set. But this is the strange part, if I changed the 2 checkboxes I still get the same output. - Original Message - From: Tijmen Hennink [EMAIL PROTECTED] To: Jason Murray [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 06, 2001 10:40 AM Subject: Re: [PHP] array + checkbox Sorry, I've copied some old code. It was already INPUT TYPE=checkbox name=voorraad[] - Original Message - From: Jason Murray [EMAIL PROTECTED] To: 'Tijmen Hennink' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 06, 2001 10:37 AM Subject: RE: [PHP] array + checkbox I've the following weird problem. I have a form which contains an array with values of some checkboxes. This is the HTML-part: INPUT TYPE=checkbox name=voorraad checked if checked or INPUT TYPE=checkbox name=voorraad Try INPUT TYPE=checkbox name=voorraad[] maybe...? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] array + checkbox
Hey, what is the deal with those read receipts? Do you really what one from every person that reads your messages? -Original Message- From: Tijmen Hennink [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 2:09 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array + checkbox Some extra debuginfo. When I'm submitting a page where the checkbox is not set in the beginning and in same page an checkbox that is initially set to checked I can see that the first is not set and the second is set. But this is the strange part, if I changed the 2 checkboxes I still get the same output. - Original Message - From: Tijmen Hennink [EMAIL PROTECTED] To: Jason Murray [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 06, 2001 10:40 AM Subject: Re: [PHP] array + checkbox Sorry, I've copied some old code. It was already INPUT TYPE=checkbox name=voorraad[] - Original Message - From: Jason Murray [EMAIL PROTECTED] To: 'Tijmen Hennink' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, August 06, 2001 10:37 AM Subject: RE: [PHP] array + checkbox I've the following weird problem. I have a form which contains an array with values of some checkboxes. This is the HTML-part: INPUT TYPE=checkbox name=voorraad checked if checked or INPUT TYPE=checkbox name=voorraad Try INPUT TYPE=checkbox name=voorraad[] maybe...? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]