SOS: Retain values on Submit in Textfield,Dropdown
Posted - 03/06/2006 : 2:35:35 PM
--------------------------------------------------------------------------------
I have a page split up into different forms. I have the top most which has a text field and a dropdown menu (in which there are 2 values coming from two different tables) Next to the dropdown list is a submit button, which on clicking will retrieve some data with checkboxes at the bottom of the page.
My problem is I cannot retain what the user entered in the report name and what was chosen in the dropdown after clicking on the SUBMIT button.
I CAN retrieve the values in the variables at the bottom of the code AFTER clicking on Submit. My only problem is how do I retain them in the text field and dropdownlist.
================================================== ===================
<form name="Report_Drive" action="pop_results_page.asp" method="GET" onsubmit="return Form1_Validator(this)">
<table border="0" width="100%" cellpadding="5" cellspacing="5">
<tr>
<td width="40%" align="left">
Enter Report Name
<input type="text" size=62 name="report_name" style="top: 30px; left: 393px; width: 180px" maxlength=150 id=report_name value=<%Request.QueryString("report_name")%>>
</td>
<td width="60%" align="left">
Choose a Drive Period from the list
<select ID="drive" name="drive" language="javascript" onchange="return drive_onchange(Results_Report)">
<option id=0 value=0>Select a new Drive Period...</option>
<%
set rst=Server.CreateObject("adodb.recordset")
strSQL = "SELECT * FROM POPD_FY_DRIVE"
rst.Open strSQL,conn
Do while not rst.eof
if rst("FY_DRIVE_ID") = Request.Form("drive") then
Response.Write("<option value=" & rst("FY_DRIVE_ID") &"SELECTED>" )
Response.Write (rst("YEAR_KEY")& " " & rst("YEAR_DRIVE_DESC") & "</option>" )
else
Response.Write("<option value=" & rst("FY_DRIVE_ID") &">" )
Response.Write (rst("YEAR_KEY")& " " & rst("YEAR_DRIVE_DESC") & "</option>" )
rst.MoveNext
end if
Loop
rst.close%>
</select>
<input type="submit" name="RetrieveSKUs" value="RetrieveSKUs" onclick="Javascript:retain();">
</tr>
</form>
<% dim tempname
tempname=Request.QueryString("report_name")
Response.Write("Hello - you chose Report Name: " & tempname )
session("report_name") = tempname
%>
<br>
<%
dim tempdrive
tempdrive=Request.QueryString("drive")
Response.Write("Hello - you chose drive: " & tempdrive )
session("drive") = tempdrive
%>
|