Name: TJD 2007-05-13 18:01 ID:LbHyk12n
Unfortunately I have to write an application for a client in ASP. For some reason they think that ASP/SQL Server is the way to go. Anyway, I'm trying to do a simple select population and tag on "selected" to whichever one the current ID matches up with. Here's my code:
While Not jobs.EOF
If jobs.Fields.Item("title") <> "" Then
Response.Write "<option value=""" & jobs.Fields.Item("id").Value & """"
If jobs.Fields.Item("id").Value = id Then
Response.Write " selected"
End If
Response.Write ">" & jobs.Fields.Item("title").Value & "</option>"
End If
jobs.MoveNext()
Wend
However, it doesn't output selected for any of them (I've made sure numerous times that they are actually equal, and every single time it's correct). What's the deal here?
While Not jobs.EOF
If jobs.Fields.Item("title") <> "" Then
Response.Write "<option value=""" & jobs.Fields.Item("id").Value & """"
If jobs.Fields.Item("id").Value = id Then
Response.Write " selected"
End If
Response.Write ">" & jobs.Fields.Item("title").Value & "</option>"
End If
jobs.MoveNext()
Wend
However, it doesn't output selected for any of them (I've made sure numerous times that they are actually equal, and every single time it's correct). What's the deal here?