How to pass back all values from a link ?

Results 1 to 3 of 3

Thread: How to pass back all values from a link ?

  1. #1
    Join Date
    Dec 1969

    Default How to pass back all values from a link ?

    I have 2 asp pages. The first page contains a long form of many fields. When the users click on the Look Up button on form 1, I change the action of form 1, and submit it to Form2. Form 2 displays a table of data. I want to add a link on the first column of Form2, so when the users click on the link it will direct the users back to Form1, and also pass back all the values that were caried to form2. I could have done this by passing the value through the query string, but Form1 has so many fields so I don't think it's a good solution. Any helps would be greatly appreciated.

  2. #2
    LeeAnnie Guest

    Default RE: How to pass back all values from a link ?

    I can think of two options. Maybe you can decide which would best suit your needs. <BR><BR>One:<BR>-----------------<BR>In the link on form 2, add all of the contents to the URL as such:<BR>&#060;a href="form1.asp?&#060;%=request.form%&#062;"&#062; Go Back&#060;/a&#062;<BR>This will, of course, attach all of the name value pairs from form 1 to the URL. The URL is long and messy, but the code is very simple, clean, and effective.<BR><BR>Two:<BR>-------<BR>Create a form full of hidden types, and then populate them all with the values in forn 1:<BR>&#060;form method="post" action="form1.asp"&#062;<BR> &#060;input type="hidden" name="value1" value="&#060;%=value1%&#062;"&#062;<BR> .<BR> .<BR> .<BR> &#060;input type="hidden" name="valueN" value="&#060;%=valueN%&#062;"&#062;<BR> &#060;input type="submit" name="could make this a link".....&#062;<BR>&#060;/form&#062;<BR><BR>Obviously, this is less desirable, code-wise. It&#039;s long and messy. But those are the two choices I can think of. <BR><BR>You can either pass values via the URL or through the header. There is no other way I can think of to pass name/value pairs (unless you delve into session variables and cookies, but that would be silly). Those are your only two options. Maybe someone out there is a little more creative than me.<BR><BR><BR>HTH<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Trying the first way

    I&#039;m trying the first way first. Thanks for your helps!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts