•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 374,176 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,436 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 756 | Replies: 4
![]() |
•
•
Join Date: Aug 2007
Posts: 98
Reputation:
Rep Power: 1
Solved Threads: 0
I created a user registration page using ASP and Dreamweaver, I tried to create a drop down box filled with options from a database. I only wanted the box to contain one of each option but it contains every one, one for each user when i view this in firefox. when i view the page in explorer the box does not contain anything and the options are all listed below the box.
part of the code is underlined, when i hover over it i get an message 'The title attribute of the SELECT tag is not supported [Netscape Navigator 4.0, Netscape Navigator 6.0]' I do not know what this error means, is this why the drop down box won't work??
heres part of my code, the line in red is the line that is underlined:-
Thanks!
Any ideas gretaly apprecitated!
GLT
part of the code is underlined, when i hover over it i get an message 'The title attribute of the SELECT tag is not supported [Netscape Navigator 4.0, Netscape Navigator 6.0]' I do not know what this error means, is this why the drop down box won't work??
heres part of my code, the line in red is the line that is underlined:-
Dim rs_accesslevel
Dim rs_accesslevel_numRows
Set rs_accesslevel = Server.CreateObject("ADODB.Recordset")
rs_accesslevel.ActiveConnection = MM_dbtest_STRING
rs_accesslevel.Source = "SELECT accesslevel FROM users"
rs_accesslevel.CursorType = 0
rs_accesslevel.CursorLocation = 2
rs_accesslevel.LockType = 1
rs_accesslevel.Open()
rs_accesslevel_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>register</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h3>Please register new user below:-</h3>
<form action="<%=MM_editAction%>" method="POST" name="formregister" id="formregister">
<table width="528" height="136" border="1">
<tr>
<td width="153">username</td>
<td width="359"><input name="txtusername" type="text" id="txtusername" size="50"></td>
</tr>
<tr>
<td>password</td>
<td><input name="txtpassword" type="password" id="txtpassword" size="20"></td>
</tr>
<tr>
<td>Access level</td>
<td><select name="accesslevel" title="<%=(rs_accesslevel.Fields.Item("accesslevel").Value)%>"><input name="txtaccesslevel" type="text" id="txtaccesslevel" size="50">
<%
While (NOT rs_accesslevel.EOF)
%>
<option value="<%=(rs_accesslevel.Fields.Item("accesslevel").Value)%>" <%If (Not isNull((rs_accesslevel.Fields.Item("accesslevel").Value))) Then If (CStr(rs_accesslevel.Fields.Item("accesslevel").Value) = CStr((rs_accesslevel.Fields.Item("accesslevel").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_accesslevel.Fields.Item("accesslevel").Value)%></option>
<%
rs_accesslevel.MoveNext()
Wend
If (rs_accesslevel.CursorType > 0) Then
rs_accesslevel.MoveFirst
Else
rs_accesslevel.Requery
End If
%>Thanks!
Any ideas gretaly apprecitated!
GLT
Last edited by peter_budo : Apr 3rd, 2008 at 11:29 am. Reason: Please use [code] tags instead of italic [I]
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
2 things:
1. Title is not a w3c standardized attribute for the SELECT tag. Don't use it
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.6
2. You have an INPUT tag nested into your SELECT tag
Move this above or below the SELECT closing tag
1. Title is not a w3c standardized attribute for the SELECT tag. Don't use it
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.6
2. You have an INPUT tag nested into your SELECT tag
<td><select name="accesslevel" title="<%=(rs_accesslevel.Fields.Item("accesslevel").Value)%>"><input name="txtaccesslevel" type="text" id="txtaccesslevel" size="50">
<%Move this above or below the SELECT closing tag
•
•
Join Date: Apr 2008
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
Perhaps I may be confused with the question, but the SELECT element is a dropdown list by nature. The INPUT element is another form element and the inclusion of it within the SELECT element is why you are seeing odd results. I'm thinking you are trying to make a combo box. I'd really just remove it alltogether.
If you are looking to make a combo box where you type and find the item in a list, that's a different story and would require different code. Presumably, you would want to place the INPUT element directly above the SELECT element, but you would require JavaScript events to search the list. You would also need DHTML if you wanted the list to open and close like a combo box.
I forgot one other item in the previous post. Use the DISTINCT qualifier in your SQL statement to avoid the duplicate entries.
If you are looking to make a combo box where you type and find the item in a list, that's a different story and would require different code. Presumably, you would want to place the INPUT element directly above the SELECT element, but you would require JavaScript events to search the list. You would also need DHTML if you wanted the list to open and close like a combo box.
I forgot one other item in the previous post. Use the DISTINCT qualifier in your SQL statement to avoid the duplicate entries.
rs_accesslevel.Source = "SELECT DISTINCT accesslevel FROM users" •
•
Join Date: Apr 2008
Posts: 34
Reputation:
Rep Power: 1
Solved Threads: 1
try following
asp Syntax (Toggle Plain Text)
<td><input value="<%=(rs_accesslevel.Fields.Item("accesslevel").Value)%>" name="txtaccesslevel" type="text" id="txtaccesslevel" size="50"> <select name="accesslevel"> <% While (NOT rs_accesslevel.EOF) %> <option value="<%=(rs_accesslevel.Fields.Item("accesslevel").Value)%>" <%If (Not isNull((rs_accesslevel.Fields.Item("accesslevel").Value))) Then If (CStr(rs_accesslevel.Fields.Item("accesslevel").Value) = CStr((rs_accesslevel.Fields.Item("accesslevel").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_accesslevel.Fields.Item("accesslevel").Value)%></option> <% rs_accesslevel.MoveNext() Wend %> </select> <% If (rs_accesslevel.CursorType > 0) Then rs_accesslevel.MoveFirst Else rs_accesslevel.Requery End If %>
Last edited by peter_budo : Apr 20th, 2008 at 6:45 pm. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
Other Threads in the ASP Forum
- Previous Thread: SQL server date time formating in ASP page
- Next Thread: adding new database tables and columns through dreamweaver???


Linear Mode