Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 28th, 2004, 07:02 PM
Authorized User
 
Join Date: Apr 2004
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default session help

I'm trying to accomplish the following. I'm trying to get the values for table rows that are dynamically created to persist through a redirect.

Referring URL:
http://www.dwayneepps.com/abr_site/fundingrequest.asp

If you click on the "New Transaction" button it will generate a new row for
the user to input information. I call a javascript function when the user
clicks the "New Transaction" button that redirects to another page that
processes some ASP code that builds a new row. I use a loop to create the
table rows by incrementing a session variable everytime the user clicks on
the "New Transaction" button.

Here is the structure of the loop:
<%
Session("url") = 2
Dim x
For x = 0 to Session("TotalRowsB")
%>
<tr>
<td><input name="yr<%=x%>" type="text" id="yr<%=x%>"
value="<%=Session("yr")%>" size="5" maxlength="25"></td>
<td><select name="strategy<%=x%>">
<option selected>-select-</option>
</select></td>
<td><input name="BA<%=x%>" type="text" value="" size="15"></td>
<td><select name="BO<%=x%>">
<option selected>-select-</option>
</select></td>
<td><input name="origBA<%=x%>" type="text" value="10,000,000.00"
size="15" maxlength="100" readonly="true"></td>
<td><input name="IncrDecr<%=x%>" type="text" value=""
size="10"></td>
</tr>
<%
Next
%>

The field names increment by one for every new row that is created. For
example, the field "yr" would be "yr1", "yr2", "yr3" on each pass through
the loop.

I'm lost on how to maintain the user's input when a new row is created. I'm
thinking I can use a session variable, but I'm not sure how to capture the
user's input into the session variable.

Any help is greatly appreciated. Thanks.
-Dman100-

Reply With Quote
  #2 (permalink)  
Old November 29th, 2004, 12:45 AM
Authorized User
 
Join Date: Aug 2003
Location: , , India.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you simply want to collect the values of different transactions ( the fields above "New Transaction" Button ). Then i think you dont need to do location.replace('buildrows.asp').
Simply in the Javascript on the click of the "New Transaction" Button iterate through all the required fields and append the values to any hidden field.
Separate the values of a specific transaction with a separator, say (~ tilde) and as soon ur done with this clear all the fields of the previous transaction. Now when the user clicks the button again then append the new transaction values to the hidden field, but do separate the different transaction values with another separator say (| pipe). Finally u may split these values when u need to process them.

Vinay

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
session komalpriya .NET Framework 2.0 4 October 30th, 2007 09:16 AM
session lakshmi devi Classic ASP Basics 4 July 20th, 2006 04:33 AM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM
About Session mani_he Beginning PHP 7 September 18th, 2004 03:47 PM
Session quinn Classic ASP Basics 12 November 19th, 2003 10:42 AM



All times are GMT -4. The time now is 10:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.