Retaining select box based values on page refresh
<p>i have problem in drop down select menu from mysql and database</p>

<p>whenever i select the value from drop down select value page reload and page refresh and then return to option select option?</p>

<pre><code>function getComboB(sel) { 

var roomtype=document.getElementById("roomtype");
var value = sel.options[sel.selectedIndex].value;
checkin.action = "checkin.php?item_combo="+value+"";
checkin.submit();

}



&lt;select name="roomtype" id="roomtype" style="width:150px;"  onchange="getComboB(this)"&gt;

  &lt;option&gt;&lt;--Select--&gt; &lt;/option&gt;


       $query=mysql_query("SELECT * FROM roomtype order by id");
      while($row=mysql_fetch_assoc($query))
      {

    $val2=$row['id'];

    ?&gt;
     &lt;option  value="&lt;?=$val2;?&gt;"  &lt;? if ($roomtype  == $val2) { echo "selected='selected'"; }?&gt; &gt; &lt;?=$row['roomtype'];?&gt; &lt;/option&gt;


      &lt;?php }?&gt;


    &lt;/select&gt;
</code></pre>
