Sunday, April 4, 2010

Help transfering data from one page to...

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 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

[code]

%26lt;%

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

%%26gt;

%26lt;html%26gt;

%26lt;head%26gt;

%26lt;title%26gt;Untitled Document%26lt;/title%26gt;

%26lt;meta http-equiv=''Content-Type'' content=''text/html;
charset=iso-8859-1''%26gt;

%26lt;/head%26gt;



%26lt;body%26gt;

%26lt;form action=''page2.asp'' method=''post'' name=''searchForm''
id=''searchForm''%26gt;

%26lt;table border=''0'' cellpadding=''0'' cellspacing=''4''
bgcolor=''#E0E0C2''%26gt;

%26lt;tr%26gt;

%26lt;td%26gt;

%26lt;select name=''Keyword'' id=''Keyword''%26gt;

%26lt;option value=''''%26gt;Choose Species Type%26lt;/option%26gt;

%26lt;%

While (NOT rsTest.EOF)

%%26gt;

%26lt;option
value=''%26lt;%=(rsTest.Fields.Item(''Species'').Value)%%26gt;''%26gt;%26lt;%=(rsTest.Fields.Item(''Spec ies'').Value)%%26gt;%26lt;/option%26gt;

%26lt;%

rsTest.MoveNext()

Wend

If (rsTest.CursorType %26gt; 0) Then

rsTest.MoveFirst

Else

rsTest.Requery

End If

%%26gt;

%26lt;/select%26gt;

%26lt;/td%26gt;

%26lt;td%26gt;%26lt;input name=''Submit'' type=''submit'' id=''Submit4''
value=''Search''%26gt;

%26lt;/td%26gt;

%26lt;/tr%26gt;

%26lt;/table%26gt;

%26lt;/form%26gt;

%26lt;/body%26gt;

%26lt;/html%26gt;

%26lt;%

rsTest.Close()

Set rsTest = Nothing

%%26gt;

[/code]



Page 2

[code]

%26lt;%

Dim rsTest__MMColParam

rsTest__MMColParam = ''1''

If (Request.Form(''Species'') %26lt;%26gt; '''') Then

rsTest__MMColParam = Request.Form(''Species'')

End If

%%26gt;

%26lt;%

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

%%26gt;

%26lt;html%26gt;

%26lt;head%26gt;

%26lt;title%26gt;Untitled Document%26lt;/title%26gt;

%26lt;meta http-equiv=''Content-Type'' content=''text/html;
charset=iso-8859-1''%26gt;

%26lt;/head%26gt;



%26lt;body%26gt;

%26lt;form action=''/html/main7.asp'' method=''post''
name=''searchForm'' id=''searchForm''%26gt;

%26lt;table border=''0'' cellpadding=''0'' cellspacing=''4''
bgcolor=''#E0E0C2''%26gt;

%26lt;tr%26gt;

%26lt;td%26gt;

%26lt;select name=''Keyword'' id=''Keyword''%26gt;

%26lt;option value=''''%26gt;Choose Species Type%26lt;/option%26gt;

%26lt;%

While (NOT rsTest.EOF)

%%26gt;

%26lt;option
value=''%26lt;%=(rsTest.Fields.Item(''Species'').Value)%%26gt;''%26gt;%26lt;%=(rsTest.Fields.Item(''Spec ies'').Value)%%26gt;%26lt;/option%26gt;

%26lt;%

rsTest.MoveNext()

Wend

If (rsTest.CursorType %26gt; 0) Then

rsTest.MoveFirst

Else

rsTest.Requery

End If

%%26gt;

%26lt;/select%26gt;

%26lt;/td%26gt;

%26lt;td%26gt;%26lt;input name=''Submit'' type=''submit'' id=''Submit''
value=''Search''%26gt;

%26lt;/td%26gt;

%26lt;/tr%26gt;

%26lt;/table%26gt;

%26lt;/form%26gt;

%26lt;/body%26gt;

%26lt;/html%26gt;

%26lt;%

rsTest.Close()

Set rsTest = Nothing

%%26gt;

[/code]



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



Cheers

Mally

No comments:

Post a Comment