Wrox Programmer Forums
| 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 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 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:

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")
<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>
<td><input name="BA<%=x%>" type="text" value="" size="15"></td>
<td><select name="BO<%=x%>">
<option selected>-select-</option>
<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=""

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.

  #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

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.


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

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