It would be nice

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I think this capability is lacking in php.

Suppose there is a group of checkboxes all named "procedure".  Doing a
$_POST['procedure'] returns all the ones that are checked and not the
ones that are not checked.  It would be nice if there were a way to get
them all and then discern which were checked.  [Note: This can be done
in Javascript with document.getElementsByName('procedure') and then
testing  whether each of the child nodes is checked].

This post arose from a question I had posted in comp.lang.mysql.  I have
a group of checkboxes and I would like to be able to put them all into
the database table, specifying which was checked and which was not. The
only way I can see doing that is to (a) sort the array by ID that is
returned from the $_POST and (b) compare each element in it with a list
of all the checkboxes ordered by ID used to generate the form.  A little
tedious, but it would work.

Re: It would be nice

sheldonlg pisze:
Quoted text here. Click to load it

It has nothing to do with PHP.

Radek N.

Re: It would be nice

On Thu, 13 Nov 2008 08:31:13 -0500, sheldonlg <sheldonlg> wrote:
Quoted text here. Click to load it

DOM != POST/GET request.

Quoted text here. Click to load it

Sounds like you're trying to use the wrong approach.  This has
nothing to do with PHP and everything to do with how the (X)HTML spec
defines "successful controls."[1]  Since your "problem" is actually
standard HTML behavior, it is the same with any language processing
the request.

Before attempting to fault a language, you should attempt to better
understand the issue at hand.

[1] <URL: -
$email = str_replace('sig.invalid', '', $from);

Site Timeline