Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value not showing in drop down list

Status
Not open for further replies.

jasonhuibers

Programmer
Sep 12, 2005
290
CA
Wow I am really stuck on this one - I dont actually see the value in the drop down list when I view the page but when I do a View Source the values are populated. Can anyone help me out here!!!

Dim sql_insert
Dim drs
ConnectStr = "Driver={SQL Server};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
data_source = "DSN=CaterDB"
sql_insert = "SELECT Community FROM Stores"
set conn2 = CreateObject("ADODB.Connection")
conn2.open ConnectStr

set drs = CreateObject("adodb.recordset")
drs.open sql_insert,conn2
%>

<tr>
<td height="25" width="166" align="left" valign="top" style="font-family: tahoma, helvetica; font-size: 11px; line-height: 14px">
<b>City*</b></td>
<td height="25" width="265" align="left" valign="top" style="font-family: tahoma, helvetica; font-size: 11px; line-height: 14px">
<select size="1" name="cboClientCity" style="font-family: Tahoma; font-size: 10px" tabindex="3">

'''Code below
<option selected value="-1">Select One</option>
<%do while not drs.eof %>
<option value="<%= drs("Community").value %>"><%= drs("Community").value %></option>
<%drs.MoveNext
Loop
conn2.close
set conn2 = nothing %>
</select>
 
><select [red]size="1"[/red] name="cboClientCity" style="font-family: Tahoma; font-size: 10px" tabindex="3">
[tt]<select name="cboClientCity" style="font-family: Tahoma; font-size: 10px" tabindex="3">[/tt]
 
You don't see which values? some? all? The below code is a sample of the html result of your code, and it works fine. how does it differ from your "view source"?

Code:
<html><body><table>

<tr>
<td height="25" width="166" align="left" valign="top" style="font-family: tahoma, helvetica; font-size: 11px; line-height: 14px">
<b>City*</b></td>
<td height="25" width="265" align="left" valign="top" style="font-family: tahoma, helvetica; font-size: 11px; line-height: 14px">

<select size="1" name="cboClientCity" style="font-family: Tahoma; font-size: 10px" tabindex="3">

'''Code below
<option selected value="-1">Select One</option>
<option value="aaaaa">aaaaa</option>
<option value="bbbbb">bbbbb</option>
<option value="ccccc">ccccc</option>

</select>

</table></body></html>
 
'''Code below
<option selected value="-1">Select One</option>
<option value="aaaaa">aaaaa</option>
<option value="bbbbb">bbbbb</option>
<option value="ccccc">ccccc</option>


I do not see any of the values after the <option value="aaaaa">THE VALUE HERE (the value without the "") However when I do a view source on the web page I see the list is filled with the correct values...
 
Here is how the code appears different:

'''Code below
<option selected value="-1">Select One</option>
<option value="aaaaa"></option>
<option value="bbbbb"></option>
<option value="ccccc"></option>
 
So, "view source" shows this:
<option selected value="-1">Select One</option>
<option value="aaaaa">aaaaa</option>
<option value="bbbbb">bbbbb</option>
<option value="ccccc">ccccc</option>

But the dropdown looks like this:
[tt]+------------+--+
| Select One | |
+------------+--+
| |
| |
| |
+------------+--+[/tt]


?? All i can think of is CSS or javascript changing something dynamically?
 
Surely this isn't all the code and it really is at least wrapped in <form> tag and nested properly in (semi)valid HTML?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top