Re: Re: Dummy question about knowing marked checkboxes
| From: | Mikey | Date: | Tue, 31 May 2005 01:25:35 +0000 |
| Subject: | Re: Re: Dummy question about knowing marked checkboxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216013@lists.php.net to get a copy of this message | ||
info@globalissa.com wrote:
The name property currrently set as the value of name='interesses' ... should be different for each different checkbox. Then you test for the value of 'on' or 'off'. If the checkbox is checked then the default value will be 'on'. In your code you have set values but those are not strictly necessary because if no value is declared then 'on' or 'off' are used. Perhaps you may consider using the values Alojamento, Artesanato and Eventos for the names instead like this? Example: Alojamento <input name='alojamento' type='checkbox'> Artesanato <input name='artesanato' type='checkbox'> Eventos <input name='eventos' type='checkbox'> Here's a basic checkbox article which may help: http://www.globalissa.com/articles/articleCheckbox.php Rob http://www.globalissa.com === with reference to: snip My dummy question, for which i apologise once more is: after submitting the form, how can i know which chekboxes were checked ? Thanking you in advance. Warm Regards, Mário Gamito <input name="foo" value="bar" type="checkbox"> BarWould result in $_REQUEST['foo'] being a) set and b) hold the value of "bar". regards, Mikey