PDA

Click to See Complete Forum and Search --> : Combo boxes??....AGAIN!!


gilly
Aug 22nd, 2000, 03:09 AM
I am trying to display TWO combo boxes on my ASP Front end. I call the function to do this from VB BACK END, however only ONE combo box is displayed(instead of TWO):

Here's my code which should generate two combo boxes:(Maybe the layout isnt correct??? Any suggestions?

Public Sub sb_ListStandardJourney()

Dim obj As New DCStrdJourneyClass
Dim rs As New ADODB.Recordset
Set rs = obj.fn_ListStandardJourney
rs.Open
g_objSC.Response.Write "<select name=select1>" & vbCrLf
Do While Not rs.EOF
g_objSC.Response.Write "<option value=" & rs(0) & ">" & rs(1) & "</option>" & vbCrLf
rs.MoveNext
Loop
g_objSC.Response.Write "</select>" & vbCrLf

'NOW FOR MY SECOND COMBO!..

g_objSC.Response.Write "<select name=select2>" & vbCrLf
Do While Not rs.EOF
g_objSC.Response.Write "<option value=" & rs(0) & ">" & rs(1) & "</option>" & vbCrLf
rs.MoveNext
Loop
g_objSC.Response.Write "</select>" & vbCrLf

End Sub


Then i call this function from my ASP PAGE:
<%
Dim obj
set obj = server.CreateObject("UCStandardJourney.UCStrdJourneyClass")
CALL obj.sb_ListStandardJourney
Set obj = Nothing
%>

Whats the problem??????????????????????????????

Ianpbaker
Aug 22nd, 2000, 03:38 AM
The only thing I can see what could be a problem is the part where the value part of the option is filled out. is there any value of the first field that has a space in it?
If so you need to enclose the value in single pip's

"<OPTION value='" & rs(0) & "'>"

This may or may not sort out your problem

Hope it helps

Ian