Re: Re: passing values of checkboxes in PHP

From: Date: Mon, 17 May 2004 07:50:39 +0000
Subject: Re: Re: passing values of checkboxes in PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-186394@lists.php.net to get a copy of this message
John Taylor-Johnston wrote:
Gowthaman, Just at a glance, it seems that you Should Only receive One value. <input type=\"checkbox\" Name=protid value=\"$variable\"> 'Name=protid' tells me that you have only created one value. Because they ALL have the SAME name="protid" there will be only one value. This would be more evident if they were type=radiobox. What you need is to generate: <input type=\"checkbox\" Name=protid1 value=\"$variable\"> <input type=\"checkbox\" Name=protid2 value=\"$variable\"> <input type=\"checkbox\" Name=protid3 value=\"$variable\"> <input type=\"checkbox\" Name=protid4 value=\"$variable\">
Or give all name="protid[]" and you will get array $_POST['protid'] that you can loop over.

« previous php.general (#186394) next »