Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 6th, 2006, 11:25 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
    %>




  #2 (permalink)  
Old March 7th, 2006, 07:12 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Please don not cross post. Why run the risk of taking up tice as many peoples time?

This post has been resolved:
http://p2p.wrox.com/topic.asp?TOPIC_ID=40995

Wind is your friend
Matt


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retain values of dynamic controls when page fozia_izhar .NET Framework 1.x 1 February 7th, 2007 02:32 PM
How to retain form values from dependent list ? George B Javascript 0 September 15th, 2006 03:54 PM
SOS Retain values on SubmitText field and DropDown rabbit124 Classic ASP Basics 17 March 7th, 2006 07:15 PM
Retain form values qhong Javascript 1 May 13th, 2004 02:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.