Re: Check box with same name
| From: | John Nichel | Date: | Fri, 01 Nov 2002 22:11:23 +0000 |
| Subject: | Re: Check box with same name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122466@lists.php.net to get a copy of this message | ||
Add square brackets to the end of the name of each check box, ie...
<input type="checkbox" name="searchStr[]" value="Where">
And on the page you submit the form too, you will be able to access this as an array...
$_POST['searchStr'] or $_GET['searchStr'], depending on the method the form was posted by.
ppf wrote:
Hi all: I am having a problem in accessing form data from multiple check box of same name with different values, like this <input type="checkbox" name="searchStr" value="Where">Where</td> <td width="40%"> <input type="checkbox"name="searchStr" value="would">would</td> <td width="40%"> <input type="checkbox"name="searchStr" value="Luluk,">Luluk,</td></tr><tr> <td width="40%"> <input type="checkbox"name="searchStr" value="Indonesian">Indonesian</td> <td width="40%"> ons,</td>How can i access these multiple selected value in same name? I am trying to move my asp code to PHP, Thanks in advance Prad __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/