Re: [PHP] Form element names as array

2002-03-04 Thread Matt

> with checkboxes, the value of the checkbox is sent to the serveronly if
it's
> checked - if it's not chesked, then it's value does go to the server

And, because of that, checkBox[0] is the first box *checked*, not the first
in the html.


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




RE: [PHP] Form element names as array

2002-03-04 Thread Kevin Stone

One suggestion may be to use two radio buttons in place of one check box
so the "true" and "false" values are sent regardless of which is chosen.
-Kevin

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]] 
Sent: Monday, March 04, 2002 3:28 PM
To: 'Chris Boget'; PHP General
Subject: RE: [PHP] Form element names as array

with checkboxes, the value of the checkbox is sent to the serveronly if
it's
checked - if it's not chesked, then it's value does go to the server

HTH
Martin

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 9:13 AM
To: PHP General
Subject: [PHP] Form element names as array


I know you can set up some form elements as array names
so that when the form is submitted, you can access the values
of those form elements, you can iterate through the array.  So
you can set up a bunch of form elements with the name

form_elements[]

and then when the form is submitted, you can just iterate through
$form_elements to get the values.  Can you do this with checkbox
element types?  I've tried but it seems like I cannot determine of
the box has been checked or not.  Has anyone done this with a
set of checkboxes?  If so, how were you able to get it to work?

Any help would be greatly appreciated!

Chris


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



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




RE: [PHP] Form element names as array

2002-03-04 Thread Martin Towell

with checkboxes, the value of the checkbox is sent to the serveronly if it's
checked - if it's not chesked, then it's value does go to the server

HTH
Martin

-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05, 2002 9:13 AM
To: PHP General
Subject: [PHP] Form element names as array


I know you can set up some form elements as array names
so that when the form is submitted, you can access the values
of those form elements, you can iterate through the array.  So
you can set up a bunch of form elements with the name

form_elements[]

and then when the form is submitted, you can just iterate through
$form_elements to get the values.  Can you do this with checkbox
element types?  I've tried but it seems like I cannot determine of
the box has been checked or not.  Has anyone done this with a
set of checkboxes?  If so, how were you able to get it to work?

Any help would be greatly appreciated!

Chris


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