Re: Form CheckBox question

From: Date: Thu, 18 Sep 2003 18:12:42 +0000
Subject: Re: Form CheckBox question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163039@lists.php.net to get a copy of this message
From: "Yves Arsenault" <yves@carrefour.peicaps.org> > I have this in my form.... the checkUnCheck(this); will uncheck values 1,2,3 > if None is chosen... Now when I submit this form, the output I get from > $Avail is the word Array and not the actual content.... ('1,2,3' if I choose > 1,2,3) > <td> > <input type="Checkbox" name="Avail[]" value="1" > onclick="checkUnCheck(this);">1&nbsp; > <input type="Checkbox" name="Avail[]" value="2" > onclick="checkUnCheck(this);">2&nbsp; > <input type="Checkbox" name="Avail[]" value="2" > onclick="checkUnCheck(this);">3&nbsp; > <input type="Checkbox" name="Avail[]" value="" > onclick="checkUnCheck(this);">None&nbsp; > </td> > > Am I missing something?? Kind of. $Avail IS an array (because you named it correctly with [ and ]), that's why you get that. If you check "2", then you should have $Avail[0] = 2 in PHP. If you check more than one box, then you'll have $Avail[0], $Avail[1], etc. ---John Holmes...

« previous php.general (#163039) next »