Re: multiple checkboxes

From: Date: Mon, 02 Aug 2004 20:44:28 +0000
Subject: Re: multiple checkboxes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-192496@lists.php.net to get a copy of this message
* Thus wrote Josh Close: > Very simple question..... > > When making multiple checkboxes, you put the name the same for a few > to group them together > > <form action="process.php" method="post"> > <input type="checkbox" name="checkBoxGroup" value="first" > /> > <input type="checkbox" name="checkBoxGruop" value="second" > /> > </form> > > ... > How would I get all the boxes check when "grouping" them by using the > same name for all checkboxes in the name field? <input type="checkbox" name="checkBoxGroup[]" value="first" /> <input type="checkbox" name="checkBoxGruop[]" value="second" /> print_r($_POST['checkBoxGroup']); If none are checked $_POST['checkBoxGroup'] will be empty() Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid!

« previous php.general (#192496) next »