Re: SV: [PHP4BETA] isset(checkbox) vs. isset(text)
| From: | Paul McGarry | Date: | Mon, 21 Feb 2000 13:17:44 +0000 |
| Subject: | Re: SV: [PHP4BETA] isset(checkbox) vs. isset(text) | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10575@lists.php.net to get a copy of this message | ||
Johan Ekenberg wrote:
> 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 :-)
It's consistant with radio button behavior (and radio buttons are exactly the
same as checkboxes, with the additional constraint that lonly one can be
active for a given name),
ie if it makes sense to you that a GET submitted form containing:
<input type=radio name=language value=french>
<input type=radio name=language value=german>
<input type=radio name=language value=english>
<input type=radio name=language value=japanese>
<input type=radio name=language value=spanish>
should return (for example)
blahblah.blah?language=english
rather than
blahblah.blah?language=&language=&language=english&language=&language=
Then the same should be true for checkboxes, ie a form containing:
<input type=checkbox name=language value=french>
<input type=checkbox name=language value=german>
<input type=checkbox name=language value=english>
<input type=checkbox name=language value=japanese>
<input type=checkbox name=language value=spanish>
Should return something like (for example):
blahblah.blah?language=english&language=spanish
rather than:
blahblah.blah?language=&language=&language=english&language=&language=spanish
This could be particularly important in the (unlikely perhaps) case that an
empty string was a valid response:
<input type=checkbox name=blah value='sdasd'>
<input type=checkbox name=blah value='fdgdfre'>
<input type=checkbox name=blah value='vdgdf'>
<input type=checkbox name=blah value='asdsawf'>
<input type=checkbox name=blah value=''>
Paul.
PS The multi language checkbox thingy above obviously wouldn't be much use in
PHP, the input fields would need to be named 'language[]' to be turned into a
useful array on submission.