Forums

This topic is locked

Help with form transfering data from one to other

Posted 28 Mar 2007 06:36:55
1
has voted
28 Mar 2007 06:36:55 Malcolm X posted:
Hi there, I am using Dreamweaver and just can't figure this out.

I have the following form which pulls names from a database in a drowp down.

I have exactly the same form on a second page which has exactly 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
<pre id=code><font face=courier size=2 id=code>
&lt;%
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
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="page2.asp" method="post" name="searchForm" id="searchForm"&gt;
&lt;table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2"&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;
&lt;select name="Keyword" id="Keyword"&gt;
&lt;option value=""&gt;Choose Species Type&lt;/option&gt;
&lt;%
While (NOT rsTest.EOF)
%&gt;
&lt;option value="&lt;%=(rsTest.Fields.Item("Species".Value)%&gt;"&gt;&lt;%=(rsTest.Fields.Item("Species".Value)%&gt;&lt;/option&gt;
&lt;%
rsTest.MoveNext()
Wend
If (rsTest.CursorType &gt; 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;input name="Submit" type="submit" id="Submit4" value="Search"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsTest.Close()
Set rsTest = Nothing
%&gt;
</font id=code></pre id=code>

Page 2
<pre id=code><font face=courier size=2 id=code>
&lt;%
Dim rsTest__MMColParam
rsTest__MMColParam = "1"
If (Request.Form("Species" &lt;&gt; "" Then
rsTest__MMColParam = Request.Form("Species"
End If
%&gt;
&lt;%
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
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="/html/main7.asp" method="post" name="searchForm" id="searchForm"&gt;
&lt;table border="0" cellpadding="0" cellspacing="4" bgcolor="#E0E0C2"&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;
&lt;select name="Keyword" id="Keyword"&gt;
&lt;option value=""&gt;Choose Species Type&lt;/option&gt;
&lt;%
While (NOT rsTest.EOF)
%&gt;
&lt;option value="&lt;%=(rsTest.Fields.Item("Species".Value)%&gt;"&gt;&lt;%=(rsTest.Fields.Item("Species".Value)%&gt;&lt;/option&gt;
&lt;%
rsTest.MoveNext()
Wend
If (rsTest.CursorType &gt; 0) Then
rsTest.MoveFirst
Else
rsTest.Requery
End If
%&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;td&gt;&lt;input name="Submit" type="submit" id="Submit" value="Search"&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsTest.Close()
Set rsTest = Nothing
%&gt;
</font id=code></pre id=code>

I just can't figure out what I am doing wrong.

Cheers
Mally
<font face='Arial'></font id='Arial'><font color=blue></font id=blue>

Reply to this topic