ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 24th, 2003, 09:21 AM
rosenzl rosenzl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 12 rosenzl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP - Attempting to preserve input fields

I have a .asp form page that submits to another .asp page that uses cdonts to send me an email and does a response.redirect back to the form page. I need to preserve (keep) a couple of text box values and a couple of dropdown box values. At this point I have global.asa variables for the fields in question and they are all set to null. I can't figure out how to put the contents back in the fields, when it returns from the cdonts page. I assume that I must save all the field values in the session variables just prior to the submit to the cdonts page.

If you can show me how to accomplich this for one text field called name and one dropdown box called PUDeliv (one option for pickup and one for delivery), it would be greatly appreciated.

To get a better picture, go to www.faxfoodorder.com/newpage2.asp - This page submits to /get.asp which retrieves all the form fields and sends an email using cdonts and then redirects back to newpage2.asp.

Larry

P.S. I use outlook, IE 6.0

Reply With Quote
  #2  
Old February 24th, 2003, 12:44 PM
jholmes jholmes is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 15 jholmes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i do the same thing with my forms, where when it redirects back to the form but maintains the values. first i used a querystring; this worked fine, until i started using textareas, which allowed for multiple lines of input. so now i use forms. whatever section the code enters, i have it write out a form with hidden input elements set to the values of the form. then the form submits itself in javascript code when the page loads. on the form end, then, i retrieve the variables. for text fields, it's as simple as putting the variables straight into the inputs, but to have drop down boxes select the appropriate option, it gets tricky. here's what i did for that:

//This function writes "selected" for the matching term when the
//user has entered invalid info, and is redirected back to the form
//to fill in appropriate information
//num is any one of the following
//1 = gender, 2 = birthmonth, 3 = birthday, 4 = state
//option is the value of the option that's being written
function select(num, option) {
var category;
if (num == 1) { category = gender; }
else if (num == 2) { category = birthmonth; }
else if (num == 3) { category = birthday; }
else if (num == 4) { category = state; }
option = new String(option);
category = new String(category);
if(option.valueOf() == category.valueOf()) {
Response.Write(" selected");
}
}


then an example of when the page writes the select input:

<select class="formselect" name="gender">
<option<%select(1, "");%>></option>
<option<%select(1, "Male");%>>Male</option>
<option<%select(1, "Female");%>>Female</option>
</select>

that's my solution anyway... if you want to use session variables to store form info, i'd think that would work , too:

Session("name") = name
Session("PUDeliv") = PUDeliv

you'll still have to do the function call for PUDeliv's select input

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP - Attempting to preserve input fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway