Re: Combo box selected value...
| From: | Rick Emery | Date: | Thu, 06 Jun 2002 19:09:59 +0000 |
| Subject: | Re: Combo box selected value... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101004@lists.php.net to get a copy of this message | ||
the value is returned in whatever is stored in $nome. So, if $nome="var", then $var will
contain the selected value.
----- Original Message -----
From: "Alexandra Aguiar" <devil_angel@viavale.com.br>
To: <php-general@lists.php.net>
Sent: Friday, January 04, 1980 12:56 PM
Subject: [PHP] Combo box selected value...
Hi ppl...
I got the followin code to generate a combo box...
++++++++++++++
function comb_alfabeto( $resultado, $nome, $letra)
{
global $error;
$quant = mysql_num_rows($resultado);
If ($quant == 0)
{
$error->erro();
}
Else
{
//---->> Início da combbox
$cont=0;
echo('
<select name="'.$nome.'" size="1"');
echo("\n");
while ($cont < $quant) {
echo("\n");
echo(' <option value="'.mysql_result($resultado,
$cont,$letra).'">'.mysql_result($resultado,
$cont,$letra).'</option>');
$cont++;
}
echo("\n </selected>");
}
}
+++++++++++++++++++
But, how can i return the selected item value into a variable $var ???
thnx in advance...
Alexandra