default selected option in select box
Posted: Wed Aug 07, 2002 5:17 am
Hi; the idea is to have a selected default option in a select box
using mysql database...
OK?
The goal is to have the default value selected first, then update the list...
any idea?
using mysql database...
Code: Select all
//the file containing my form
<FORM METHOD="POST" ACTION="includes/update.inc" name="form_update">
<SELECT NAME="new_id_agence">
<OPTION VALUE="66">bon1</OPTION>
<OPTION VALUE="67">bon2</OPTION>
<OPTION VALUE="68">bon3</OPTION>
</SELECT>
//and the update.inc file
//Contains the fields i get back from mysql
//
$result=@mysql_query($infos_user) or die ("error sql");
if ($infos= mysql_fetch_array($result))
{
$id_agence=htmlentities(stripslashes($infosї"id_agence"]));
$ip=htmlentities(stripslashes($infosї"ip"]));
}OK?
The goal is to have the default value selected first, then update the list...
any idea?