SV: [PHP4BETA] isset(checkbox) vs. isset(text)
| From: | Johan Ekenberg | Date: | Mon, 21 Feb 2000 13:01:09 +0000 |
| Subject: | SV: [PHP4BETA] isset(checkbox) vs. isset(text) | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10573@lists.php.net to get a copy of this message | ||
> > It appears that a named input field of type "text" will always
> > set a $GLOBALS[]variable in PHP4 (even if it's empty), while a
> > named checkbox will only set the corresponding $GLOBALS[] variable
> > if it is checked.
>
> > Is it meant to be this way?
>
> Yes it is.
>
> > If so, could somebody please explain why?
>
> Because that is the way they designed it.?
> http://www.w3.org/TR/html4/interact/forms.html#checkbox
> It comes down to what they call 'successful controls'
>
> http://www.w3.org/TR/html4/interact/forms.html#successful-controls
>
> I'm sure it makes sense to you that if you have multiple radio buttons of
> the same name only the checked one gets sent through on form submission.
> The same is true for checkboxes, though you can have more than on of them
> with the same name that is successful.
>
> I hope that helps somewhat...
Yes it does. I still don't quite agree with the behaviour, but I
understand
it is not a problem of PHP but of w3 standards. I'll have to raise a few
10**6$ to start a lobbying campaign :-)
Thanks for pointing me to the "source"!
/Johan