Hello,
I have a minor problem. I have a dropdown box, that populates a textfield. the selected option is displayed, but after I submitted the form, and go back to the page the selected option is still the selected option in the box. I want it to be blank when i go back to the page.. some1 who could help me?
this is the code from the dropdown / textfield.
if(isset($POST['naam']))
{
$sql="select nummer from members where naam='$POST[naam]'";
$query = mysql_query($sql) or die(mysql_error());
while ($obj = mysql_fetch_object($query)) {
// echo 'nr: '.$obj->nummer.'<BR><BR>';
$nummer = $obj->nummer;
$SESSION['iNaam'] = $POST['naam'];
$_SESSION['iNummer'] = $nummer;
}
}
?>
<script>
function resubmit()
{
document.inv.action="cijfers.php"
document.inv.submit()
}
</script>
<?
echo '<tr><td align="center" width="500">Naam: <SELECT NAME="naam" size="1" onChange="resubmit()">';
$result = mysql_query("SELECT naam FROM members WHERE level=1 ORDER BY naam ASC");
echo '<OPTION VALUE="" selected="'.$_SESSION['iNaam'].'">'.$_SESSION['iNaam'].'</option>';
while($row = mysql_fetch_array($result)) {
/* laat items zien */
echo '<OPTION VALUE="' . $row['naam']. '" >'. $row['naam'] .'</OPTION>';
}
echo "</SELECT> ";
echo 'Nummer: <INPUT TYPE="text" NAME="nummer" VALUE="'.$nummer.'" SIZE="10" MAXLENGTH="10" DISABLED> ';
thnx...