Hi all, below please find my source code for my ASP page. What I'm trying to do is to populate the dropdown box called "ProbCat" in the form. All the code works. If I comment out the document... line and put it in a MsgBox, it displays the names from the database. Could anybody please tell me what I'm doing wrong. Any comments would be appreciated.
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="private, no-cache, must-revalidate">
<link rel="stylesheet" href="styles/global.css" type="text/css">
<script language="vbscript">
sub GetData()
dim db, rs
set db = CreateObject("adodb.connection"
set rs = CreateObject("adodb.recordset"
db.Provider = "sqloledb"
db.ConnectionString = "driver={SQL Server};server=127.0.0.1;uid=gino;pwd=global;database=MyWebDatabase;"
db.Open
set rs = db.Execute("select * from GuestInfo"
rs.MoveFirst
while not rs.EOF
document.LogIncident.ProbCat("mother"
.add rs("name"
rs.MoveNext
wend
rs.Close
db.Close
end sub
</script>
</HEAD>
<BODY>
<form name="LogIncident" method="post" action="LogIncident.asp">
<table>
<tbody>
<tr><td colspan=2><h1>Please Log Your Request</h1></td></tr>
<tr><td colSpan=2><h4>Incident Category:</h4></td></tr>
<tr>
<td class="label">Problem Category:</td>
<td>
<select name="ProbCat">
<option name="mother">
</select>
</td>
</tr>
<tr><td> </td></tr>
</tbody>
</table>
<input class="button" value="Click me" onclick="GetData()">
</form>
</BODY>
</HTML>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="private, no-cache, must-revalidate">
<link rel="stylesheet" href="styles/global.css" type="text/css">
<script language="vbscript">
sub GetData()
dim db, rs
set db = CreateObject("adodb.connection"

set rs = CreateObject("adodb.recordset"

db.Provider = "sqloledb"
db.ConnectionString = "driver={SQL Server};server=127.0.0.1;uid=gino;pwd=global;database=MyWebDatabase;"
db.Open
set rs = db.Execute("select * from GuestInfo"

rs.MoveFirst
while not rs.EOF
document.LogIncident.ProbCat("mother"


rs.MoveNext
wend
rs.Close
db.Close
end sub
</script>
</HEAD>
<BODY>
<form name="LogIncident" method="post" action="LogIncident.asp">
<table>
<tbody>
<tr><td colspan=2><h1>Please Log Your Request</h1></td></tr>
<tr><td colSpan=2><h4>Incident Category:</h4></td></tr>
<tr>
<td class="label">Problem Category:</td>
<td>
<select name="ProbCat">
<option name="mother">
</select>
</td>
</tr>
<tr><td> </td></tr>
</tbody>
</table>
<input class="button" value="Click me" onclick="GetData()">
</form>
</BODY>
</HTML>