I'm trying to populate a <select>
with <option>
's on a site with Classic ASP/VBScript. The values are read and taken from an SQL Server Database and the code for that looks similar to:
SET rows = dbc.execute(SQL)
IF NOT rows.EOF THEN
DO WHILE NOT rows.EOF
%>
<option value="<%=rows("specialty")%>"><%=rows("specialty")%></option>
<%
rows.moveNext
LOOP
ELSE
END IF
rows.close
SET rows = NOTHING
The problem I have is that only one side of the <%=rows("specialty")%>
seems to evaluate.
With <option value="<%=rows("specialty")%>"><%=rows("specialty")%></option>
I get:
<option value="fromRow1"></option>
<option value="fromRow2"></option>
<option value="fromRow3"></option>
With <option value="test"><%=rows("specialty")%></option>
I get:
<option value="test">fromRow1</option>
<option value="test">fromRow2</option>
<option value="test">fromRow3</option>
What should one do to mitigate this issue?