ive a dynamic dropdownlist, which items are retrieved frm db. but when i select an item from the dropdownlist, the item does not stay selected instead the dropdownlist make a postback and stay as default value.
wad shd i do? is there any mtd to get d value selected?
THANK YOU VERY MUCH!
related codes below--
function chktype(){
document.gt.action = 'add_user.asp?userID='+document.gt.userID.value;
document.gt.submit();
}
<select name="type" onChange="chktype();" mandatory='true' class="text">
<%sql = "select distinct * from t_user_type order by userType"
set rs = conn.execute(sql)
do while not rs.eof%>
<option value="<%=rs("userType")%>" <%if request.Form("type") =rs("userType") then response.Write(" selected")%>><%=rs("userType")%></option>
<%rs.moveNext
loop%>
</select>