Unanswered: display default value in drop down box?
here come my problem. i have drop down box which listing record from db and have onchange function which can populate textbox. my problem is how can i display in drop down default value like "-SELECT-" or just blank " ". i've try many ways but still didnt workout.
'drop down code
<select name="cboproc" size=1" id="cboproc" onChange="PopulateTextbox()">
<% do until rstproc.eof
lID = rstproc("pgprdc")%>
<option value="<%=lID%>" selected><%=rstproc("pgdesc")%> </option>
lID = document.frmTest.cboproc.value
document.frmTest.txtValue.value = document.all("intValue" & lID).value
document.frmTest.txtCost.value = document.all("intCost" & lID).value
You don't have to put the default option last, you can still put it first. Just make IT "selected", while all other options are NOT "selected" : the "selected" option is the one which will be displayed when the page is loaded. Of course, if all options are stated as "selected", the one to be displayed will be the last one you created. So ONLY ONE OPTION like this :