Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: ocean10000
I'm hoping someone can help me here.. I'm having a little problem getting something to work in Classic ASP...
here's the code snippit:
dim intTotalfamilies, rs_disp
intTotalfamilies = rs_afamlist.RecordCount
for aloop = 1 to intTotalfamilies
If not rs_afamlist.eof then
thefamilynumber = rs_afamlist("familyNumber")%>
<option value="sample.asp?whatFamToShow=<%=thefamilynumber%>" <%if whatFamToshow = thefamilynumber then%> selected <%end if%>><%=rs_afamlist("familyDisplayedName")%></option>
response.write ("oops - list is broken")
Basically.. it works.. the only bit that won't work is the tiny little IF-Then bit of logic that writes "selected" inside of an <option> that says it's selected .. I can't figure out why..
I've tested and debugged.. the variables are all passing correctly (I commented out <thefamilynumber is <%=thefamilynumber%> and whatFamToshow is <%=whatFamToShow%> - and in view source of the generated page.. the numbers all showed just as they should..
but the when I use the same variables for <%if whatFamToshow = thefamilynumber then%> selected <%end if%> then I NEVER get any condition where the computer writes selected.. even when I know there's always at least 1 instance when whatFamToshow = thefamilynumber.
it's quite annoying. and yes.. i've tried writing it : selected="selected" . same thing.. what am I doing wrong?
it's something silly and obvious isn't it?
I've just put that in.. and of course, it works great!
thanks very much for your help!