One other thing please read my comments in the code as you seem to have
forgotten that VBscript if statements are only to execute VBscript or
not to execute Vbscript.
My only question is, how are you going to handle it having several yes &
several no selected at the same time?
<select name="SelectedMultiDisabilityEvent" size="1">
<%IF RS("SelectedMultiDisabilityEvent") = "Yes" THEN%>
' execute any VBscript before the else if the statement
' is true
<option selected value="Yes">Yes</option>
<option value="No">No</option>
' No VBscript was found so I wrote everything even if it
' wasn't true because it wasn't VBscript.
'
' All the If statement is for is to to execute VBscript or
' to not execute VBscript.
<%ELSE%>
' execute any VBscript before the else if the statement
' is false
<option value="Yes">Yes</option>
<option selected value="No">No</option>
' No VBscript was found so I wrote everything even if it
' wasn't true because it wasn't VBscript.
'
' All the If statement is for is to to execute VBscript or
' to not execute VBscript.
<%END IF%>
</select>
Gert Albertse wrote:
I retrieve the recordset RS("SelectedMultiDisabilityEvent") form a
table. The data type is text.
When I run the next code:
WHILE NOT RS.EOF
Response.Write RS("SelectedMultiDisabilityEvent") & "<br>"
RS.MOVENEXT
WEND
I get the output:
Yes
No
No
Yes
But when I modify the code:
<select name="SelectedMultiDisabilityEvent" size="1">
<%IF RS("SelectedMultiDisabilityEvent") = "Yes" THEN%>
<option selected value="Yes">Yes</option>
<option value="No">No</option>
<%ELSE%>
<option value="Yes">Yes</option>
<option selected value="No">No</option>
<%END IF%>
</select>
I get the ouput:
Yes
No
No
No
It seems as if it only checks for the first recordset.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
--
Please do not contact me directly or ask me to contact you directly for
assistance.
If your question is worth asking, it's worth posting.
If it’s not worth posting you should have done a search on
http://www.google.com/ http://www.google.com/grphp?hl=en&tab=wg&q= or
http://news.google.com/froogle?hl=en&tab=nf&ned=us&q= before wasting our
time.