Re: Checkboxes

From: Date: Tue, 27 Apr 2004 15:10:29 +0000
Subject: Re: Checkboxes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184765@lists.php.net to get a copy of this message
From: "Phpu" <phpu@go.ro> > Each brand has more that one model. When i > chose a brand it displays chackboxes for each > model in a form.. > Now i want to select some models and introduce > them into database. [snip] > echo "&nbsp;&nbsp;<input type='checkbox' > name='".$name."' > value='".$id."'>&nbsp;&nbsp;$name<br>"; Each of your checkboxes should be named the same thing and made into an array. echo "&nbsp;&nbsp;<input type='checkbox' name='mycheckboxes[]' value='$id'>&nbsp;&nbsp;$name<br />"; Then, you'll have $_POST['mycheckboxes'] containing the "id" values of all boxes that were checked. Do a print_r($_POST['mycheckboxes']) to see the organization. ---John Holmes...

« previous php.general (#184765) next »