Re: (Newbie) how to evaluate a varying number of db generated checkboxes?

From: Date: Wed, 07 Mar 2001 21:08:05 +0000
Subject: Re: (Newbie) how to evaluate a varying number of db generated checkboxes?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7168@lists.php.net to get a copy of this message
If you have a way to decide which checkboxes have to be checked, just set its attribute like the line bellow: <INPUT TYPE="checkbox" NAME="" <?PHP if($condition) echo("CHECKED");?> > HTH Jayme. -----Mensagem Original----- De: jester <jester@hakkers.com> Para: <php-db@lists.php.net> Enviada em: quarta-feira, 7 de março de 2001 14:00 Assunto: [PHP-DB] (Newbie) how to evaluate a varying number of db generated checkboxes? > I'm generating a html form with php and a MySQL database. > My code generates a varying number of checkboxes depending on the number of > 'options' in my database. The name of the checkbox is set to the -id- of the > 'option' in my database. When the generated form is posted I want to show a > page showing a overview of the 'options' checked. But how do I check if that > varying number of checkboxes is 'checked' ?? > > > db connect and query, result of query is placed in: $result ............. > > while($row=mysql_fetch_array($result)) > { > print("<form method=\"post\" > action=\"formhandler.php\">"); > $optionID=$row["id"]; > $optionDescription=$row["description"]; > print("<input type=\"checkbox\" name=\"$optionID\"> > $optionDescription<br>\n"); > print("</form>"); > } > > > But how can I get this 'unknown' number of checkboxes in my next page and > evaluate if they are checked so I can leave out the unchecked ones in my > overview. > > > > > Who can help me with this problem?! > > Thanx! > H. de Visser > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#7168) next »