Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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
 
Old October 14th, 2004, 09:04 AM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default retaining the last data that was entered

I have a drop down menu that populates infromation from a database. Secondly the confirmation ask user to verify if the conten is correct.
If not correct hit the "Change Data" button which will send them back to make correction. Now the problem I am having is of the following. The drop down menu isn't defaulting to the item or data that was chosen by the user. I am not sure if the problem is in the drop down menu or the confirmation page that has to send them back to make the correction.

Can someone help me with this problem.

Thank you

 
Old October 14th, 2004, 09:38 AM
Authorized User
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when you send them back are you using a link which will refresh the page or are you using JavaScript:history.go(-1)
 
Old October 14th, 2004, 09:55 AM
Authorized User
 
Join Date: Jun 2004
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

on the submission form the drop down looks like this;

<%
Dim DcType, rsType, mySelection

set dcType=Server.CreateObject("ADODB.CONNECTION")

dcType.Open "Provider=sqloledb;Data Source=Flaflmirsql01;Initial Catalog=Retention;User Id=Retention;Password=nasa#6210;"

Set rsType = Server.CreateObject("ADODB.Recordset")

rsType.open "Type", dcType


 StrType = ""

Do While Not rsType.EOF


StrType = StrType &_
"<Option ='" & rsType("TypeID") & "'"
If (mySelection=rsType("TypeID").Value) Then
     StrType = StrType & " Selected "
End If
StrType = StrType & ">" & rsType("TypeName")&"</Option>"

rsType.MoveNext

Loop

'Clean up
rsType.Close

dcType.Close

Set rsType = Nothing

Set dcType = Nothing

%>

<SELECT name="Type"><%=strType%>

    <option value="Please Choose a Type" >Please Choose a Type</option>

   </SELECT>

Then Submit:

I am sending a JavaScript:

Which looks like this:
<%
Dim StrType
strType= Request.form("Type")

%>
<p align="center">Please confirm the data you entered is correct.<script language="JavaScript">
function ChangeData()
{
    document.form1.action = "Retention_Tool.asp";
    document.form1.submit();
}

function SubmitData()
{
    document.form1.action = "Confirmation2.asp";
    document.form1.submit();
}
</script><form name="form1" method="post">
<table width="100%" border="0">
  <tr>
    <td colspan="2">
    &nbsp;</td>
  </tr>
  <tr>
    <td width="42%">Type of Disco / Downgrade:
<b>:</b></td>
    <td width="57%"><%=strType%><input type="hidden" name="Account_Number" value="<%=strType%>"></td>
  </tr>


 
Old October 14th, 2004, 03:21 PM
Authorized User
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

did you try storing the query in a session?
 
Old October 14th, 2004, 03:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yeah, try storing it in the Session to retain it across posts.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Show fields depending on data entered in previous Vaz ASP.NET 2.0 Basics 0 June 27th, 2006 09:16 AM
Re: need to convert data entered to all caps flyfish Access 5 March 18th, 2005 12:35 PM
How to check entered data with Validator Control minhpx General .NET 2 September 15th, 2004 04:01 AM
How to check data entered 3 textboxs minhpx General .NET 1 September 13th, 2004 11:46 PM
Maintain entered data sporkman43 Classic ASP Basics 2 October 14th, 2003 02:11 AM





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