Re: dynamic checkboxes?

From: Date: Mon, 06 Aug 2001 17:03:25 +0000
Subject: Re: dynamic checkboxes?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61450@lists.php.net to get a copy of this message
On Mon, 6 Aug 2001 08:57:08 -0500, garman (garman@students.uiuc.edu) wrote: >I have a form that generates a list of "categories" dynamically. >That is, for >each category in a database, the form has a corresponding checkbox. >The >checkboxes are given serialized names, such as "chkbx1", "chkbx2", >etc. > >I'm having trouble figuring out how to process these in the php >script that >handles this form. In other words, how do I figure out which >categories were >selected when I don't know in advance how many categories there are? > How can >I check if the form variables "chkbx1", "chkbx2", etc have been set? name them chkbx[1], chkbx[2]... then on the next page go: foreach($chkbx as $key=>$value){ echo "chkbx[$key] is set.\n"; } >Thanks, >Matt > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list- >admin@lists.php.net

« previous php.general (#61450) next »