malhyp
03-28-2007, 05:40 AM
I have the following form which pulls names from a database in a drowp down.
I have almost exactly the same form on a second page which has the same form with the dropdown.
How do I "using dreamweaver" transfer what the user selects on the first form to the second form???
Page 1
<%
Dim rsTest
Dim rsTest_numRows
Set rsTest = Server.CreateObject("ADODB.Recordset")
rsTest.ActiveConnection = MM_conn_STRING
rsTest.Source = "SELECT Species FROM tblSpecies ORDER BY Species ASC"
rsTest.CursorType = 0
rsTest.CursorLocation = 2
rsTest.LockType = 1
rsTest.Open()
rsTest_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="page2.asp" method="post" name="searchForm" id="searchForm">
<table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2">
<tr>
<td>
<select name="Keyword" id="Keyword">
<option value="">Choose Species Type</option>
<%
While (NOT rsTest.EOF)
%>
<option value="<%=(rsTest.Fields.Item("Species").Value)%>"><%=(rsTest.Fields.Item("Species").Value)%></option>
<%
rsTest.MoveNext()
Wend
If (rsTest.CursorType > 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%>
</select>
</td>
<td><input name="Submit" type="submit" id="Submit4" value="Search">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsTest.Close()
Set rsTest = Nothing
%>
Page 2
<%
Dim rsTest__MMColParam
rsTest__MMColParam = "1"
If (Request.Form("Species") <> "") Then
rsTest__MMColParam = Request.Form("Species")
End If
%>
<%
Dim rsTest
Dim rsTest_numRows
Set rsTest = Server.CreateObject("ADODB.Recordset")
rsTest.ActiveConnection = MM_conn_STRING
rsTest.Source = "SELECT Species FROM tblSpecies WHERE Species = '" + Replace(rsTest__MMColParam, "'", "''") + "' ORDER BY Species ASC"
rsTest.CursorType = 0
rsTest.CursorLocation = 2
rsTest.LockType = 1
rsTest.Open()
rsTest_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="/html/main7.asp" method="post" name="searchForm" id="searchForm">
<table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2">
<tr>
<td>
<select name="Keyword" id="Keyword">
<option value="">Choose Species Type</option>
<%
While (NOT rsTest.EOF)
%>
<option value="<%=(rsTest.Fields.Item("Species").Value)%>"><%=(rsTest.Fields.Item("Species").Value)%></option>
<%
rsTest.MoveNext()
Wend
If (rsTest.CursorType > 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%>
</select>
</td>
<td><input name="Submit" type="submit" id="Submit" value="Search">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsTest.Close()
Set rsTest = Nothing
%>
I just can't figure out what I am doing wrong.
Cheers
Mally
I have almost exactly the same form on a second page which has the same form with the dropdown.
How do I "using dreamweaver" transfer what the user selects on the first form to the second form???
Page 1
<%
Dim rsTest
Dim rsTest_numRows
Set rsTest = Server.CreateObject("ADODB.Recordset")
rsTest.ActiveConnection = MM_conn_STRING
rsTest.Source = "SELECT Species FROM tblSpecies ORDER BY Species ASC"
rsTest.CursorType = 0
rsTest.CursorLocation = 2
rsTest.LockType = 1
rsTest.Open()
rsTest_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="page2.asp" method="post" name="searchForm" id="searchForm">
<table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2">
<tr>
<td>
<select name="Keyword" id="Keyword">
<option value="">Choose Species Type</option>
<%
While (NOT rsTest.EOF)
%>
<option value="<%=(rsTest.Fields.Item("Species").Value)%>"><%=(rsTest.Fields.Item("Species").Value)%></option>
<%
rsTest.MoveNext()
Wend
If (rsTest.CursorType > 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%>
</select>
</td>
<td><input name="Submit" type="submit" id="Submit4" value="Search">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsTest.Close()
Set rsTest = Nothing
%>
Page 2
<%
Dim rsTest__MMColParam
rsTest__MMColParam = "1"
If (Request.Form("Species") <> "") Then
rsTest__MMColParam = Request.Form("Species")
End If
%>
<%
Dim rsTest
Dim rsTest_numRows
Set rsTest = Server.CreateObject("ADODB.Recordset")
rsTest.ActiveConnection = MM_conn_STRING
rsTest.Source = "SELECT Species FROM tblSpecies WHERE Species = '" + Replace(rsTest__MMColParam, "'", "''") + "' ORDER BY Species ASC"
rsTest.CursorType = 0
rsTest.CursorLocation = 2
rsTest.LockType = 1
rsTest.Open()
rsTest_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="/html/main7.asp" method="post" name="searchForm" id="searchForm">
<table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2">
<tr>
<td>
<select name="Keyword" id="Keyword">
<option value="">Choose Species Type</option>
<%
While (NOT rsTest.EOF)
%>
<option value="<%=(rsTest.Fields.Item("Species").Value)%>"><%=(rsTest.Fields.Item("Species").Value)%></option>
<%
rsTest.MoveNext()
Wend
If (rsTest.CursorType > 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%>
</select>
</td>
<td><input name="Submit" type="submit" id="Submit" value="Search">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsTest.Close()
Set rsTest = Nothing
%>
I just can't figure out what I am doing wrong.
Cheers
Mally