Passing a variable to a new page's form field via hyperlink

N

Newbie

OK, this may be impossible since I'm using 3rd party shopping cart ASP
software, but I've been able to finagle a lot of other stuff I thought
wouldn't work, so here we go:

I'm using a form in which users enter numbers to be calculated into a square
footage cost. Upon submitting, the results page uses ASP to give the total
and the chance to add the new totalled item to the cart or try a new
calculation. Part of the cart's software has a "returnURL" variable you can
enter to tell what page will open up once the item is in the cart. I'm
trying to open the new page with one form field that is already filled in
with one variable that was set in the "add to cart" page. So far, I am
unable to do it.

Is it possible to fill in a form field with a variable passed from one page
without using previous form fields or submit buttons? The reason I want the
form field to use a previous variable's value is that the field, upon
submission of the 3rd page's form, will populate an Access field.

Here's the progression:

- 1st page is a form where user enters company name and several numbers in
fields for square footage calculation. Submit button goes to...
- 2nd page: No form fields, just the totals and company name, etc. A
hyperlink here uses the cart's syntax to add the order to the shopping cart.
Part of the hyperlink includes the URL to open upon adding the item to the
cart.
- 3rd page: Another form where the user enters much more detailed info
about the order into form fields, all of which populate an Access db. I
would like to carry the CompanyName from the 2nd page to this one, and
automatically enter that value in the CompanyName form field.

Here's the ASP code of the 2nd page:

<%
Dim UpchargeA
Dim Company


ON ERROR RESUME NEXT
response.write request("CompanyName")%>: Your preliminary cost, including
upcharges, is:<br><br>



<%
ON ERROR RESUME NEXT
response.write (((cInt(request("A1")) + cInt(request("A2")) +
cInt(request("B")) + cInt(request("B2")))/cInt(request("C")))*1.645)
+cInt(request("Upcharge"))
%>br><br>
Would you like to continue?&nbsp;
<p><a href="1stPage.asp">NO, return to liner quote system</a> <br><br>

<a href="ShoppingCartCodeThatAddsToCart.asp?Productname=Whatever&price=
<%
ON ERROR RESUME NEXT
response.write (((cInt(request("A1")) + cInt(request("A2")) +
cInt(request("B")) + cInt(request("B2")))/cInt(request("C")))*1.645) +
cInt(request("Upcharge"))
%>
&quantity=1&returnurl=../3rdPage.asp">Yes, I would like to purchase this
liner</a>


It's the "3rdPage.asp" that is the cart's info for what new page to open
upon placing the item in the cart. I tried using the
....asp?CompanyName=Whatever", and the corresponding ASP on the 3rd page to
populate the "CompanyName" field, but it doesn't work.

I am using FrontPage and little tidbits of asp that I'm gradually learning.
If it helps, the 3rd Page is a FrontPage Form Results page that populates
the db with all the given info upon clicking "Submit" (made by using the
Send To wizard thingy).

Thanks for any help, it is much appreciated.

PS: If the above code seems very cumbersome and can be streamlined, please
feel free to let me know. For example, I thought it was odd to have to
include the "cInt" for every form field, but it didn't work until I did.


Newbie Supreme
 
M

MDW

Try using session variables, like thus:

On your second page -

Session("CoName") = Request.Form("company_name")

On your third page:

<input type="text" name="cmpany_name_to_db" value="<%
=Session("CoName") %>">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top