473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

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?Productna me=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

Jul 19 '05 #1
1 7415
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") %>">
-----Original Message-----
OK, this may be impossible since I'm using 3rd party shopping cart ASPsoftware, but I've been able to finagle a lot of other stuff I thoughtwouldn't work, so here we go:

I'm using a form in which users enter numbers to be calculated into a squarefootage cost. Upon submitting, the results page uses ASP to give the totaland the chance to add the new totalled item to the cart or try a newcalculation. Part of the cart's software has a "returnURL" variable you canenter to tell what page will open up once the item is in the cart. I'mtrying to open the new page with one form field that is already filled inwith one variable that was set in the "add to cart" page. So far, I amunable to do it.

Is it possible to fill in a form field with a variable passed from one pagewithout using previous form fields or submit buttons? The reason I want theform field to use a previous variable's value is that the field, uponsubmission 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 infields for square footage calculation. Submit button goes to...- 2nd page: No form fields, just the totals and company name, etc. Ahyperlink 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 thecart.
- 3rd page: Another form where the user enters much more detailed infoabout the order into form fields, all of which populate an Access db. Iwould like to carry the CompanyName from the 2nd page to this one, andautomatically 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, includingupcharges, 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?
<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 thisliner</a>
It's the "3rdPage.asp" that is the cart's info for what new page to openupon placing the item in the cart. I tried using the
....asp?CompanyName=Whatever", and the corresponding ASP on the 3rd page topopulate 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 populatesthe db with all the given info upon clicking "Submit" (made by using theSend To wizard thingy).

Thanks for any help, it is much appreciated.

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

Newbie Supreme

.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
1
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL:...
4
by: hansen | last post by:
hi all, I am creating online quiz (10 questions) with radio buttions (Yes/No). When the user clicks on the submit button i do some calculation and based on that calculation i display result.aspx...
5
by: Jim Banks | last post by:
Greetings I'm opening a pop up window with a html form, (in one document) and I want to pass a variable to the html form called from the hyperlink. Here's the code I'm using to pop up the...
4
by: opt_inf_env | last post by:
Hello, I know three ways to pass variables form one page to another. The first one is to declare and set session variable. In this case if one goes to another page (by clicking on hyperlink or...
3
by: Wayne Wengert | last post by:
I have an application where a session variable is set in an ASPX page, The process calls an ASP page and when in that page the session variable appears to be null. How can I pass a session variable...
1
by: Wolfman | last post by:
Hi gang! I've been searching for a solution to this problem extensively but nothing really hits the mark. I have a descriptive popup page that contains a PayPal order button. The normal PayPal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.