hi,
when submit a form, the value of a drop-down-list is passed to a result page.
when nothing is selected in the dropdown all entrys will be viewed in the result list - when something is selected the refered value will viewed in the result page.
the problem: when option size=2 all works fine. but when option size=1 by default the first value in the list is selected and the option to view all entrys doesn't work.
here the code:
<form name="form1" method="post" action="result.php">
<?
$result = mysql_query("SELECT DISTINCT ID, Searchentry FROM lastminute ORDER BY Veranstaltungen,Badereisen,Busreisen,Flugreisen", $link);
echo "<SELECT name='select_lastminute[]' size='1'>\n";
if ($myrow = mysql_fetch_array($result))
{
do {
$varID = $myrow[ID];
print "<OPTION value=\"$varID\">$myrow[Searchentry]</OPTION>\n";
} while ($myrow = mysql_fetch_array($result));
print "</SELECT>";
}
?>
<br>
<input type=submit value=submit>
<input type="reset" name="Reset" value="Reset">
</form>
result page:
$count = count($select_lastminute);
if ($count == "")
{
//print all results
}
else
{
//print the selected value
}
would be very apprecheated for help. i didn't find a solution for this problem.
regards,
christian