I'd like to be able to remember the selected value of my dropdownlist.
Whether it be from java, a Session or Cookie and have it selected accordinaly after postback. Any help would be much appreciated.
Below is my code:
$qRtu = "SELECT ID, Name From tblOption";
$result = mysql_query($qRtu);
while ($data=mysql_fetch_assoc($result)){
?>
解决方案
You will need to put in the HTML to allow the form control to select a single selected option, something along the lines of:
echo( 'selected = "selected"' ); ?> >
The 'some_value' is something that you will need to grab from your database, or session, or cookie, or whereever you plan to grab the default value of the select box from.