473,839 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing variable from HREF to form field on another page

21 New Member
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 form fields allow for the item description, fee, etc. I'd like the fee field to be variable based upon which hyperlink launched the popup.

So,
HREF click sets a variable
INPUT TYPE (hidden) named "amount" equals the variable

Specifically, the page that has been launching the popup is a standard order page. I'm adding a discounted "sale" page which would lead to the same popup description, but since the PayPal code is absolute, the user would end up paying the standard price if the click the popup's button.

I'm trying to avoid creating separate popup pages because there's already one for foreign and one for domestic, then two of each of those for each issue.

Here's the relevant code:

REFERRER PAGE
<A HREF="javascrip t:newWindow1('i ssue01dp.html') ">Issue 1</A>

newWindow1 is defined in an external popup function.

POPUP PAGE PAYPAL FIELD
<input type="hidden" name="amount" value="9.50">

So, for example, one hyperlink would make the "amount" equal 9.50, and another hyperlink would make the resulting "amount" equal 8.50.

I'm thinking that if I could embed a number in onClick=, then call it within the form field, that'd do the trick. But I'm stuck trying to find a simple way to define the variable within this one line.
Apr 1 '08 #1
1 3754
cameokid
10 New Member
Hi,

Here is what you can try.

In the first page you can have the below onClick function in the anchor tag
Expand|Select|Wrap|Line Numbers
  1. onClick="window.open('popUpPage.html'+'?'+escape(1.5),'_blank')"
1.5 is the value you are passing to the popup page.
In the pop up page you should have a onLoad function which includes this code
Expand|Select|Wrap|Line Numbers
  1. var val = unescape(location.search.substring(1, location.search.length));
now val is going to have 1.5 and you can use this in your popup.

Is hope this is what you are looking for
Apr 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5946
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 contains: <?php $_SESSION = ""; $_SESSION = "";
1
7791
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: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
6
2116
by: Robert Rozman | last post by:
Hi, I'm total php newbie and probably have trivial problem. I have following two scripts. First creates web form and should run second script with two arguments. But those two arguments don't get to second script, cause this line print "Please enter both phone number and name!";
1
7439
by: Newbie | last post by:
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...
6
2755
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid = server.createobject("scriptlet.typelib").guid guid=Left(guid,instr(guid,"}")) genguid=guid
4
1706
by: JA | last post by:
I have this little tell-a-friend script that will send out a link back to the site. I want to put a link on my product pages that will go to the script, and have the script display the product name, and have the product name in the email that goes out, along with a link back to the product page, instead of just to the general site, and then have the Thank You page include a link back to the product. I put it up as a project on a...
5
6702
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage & "<br>"%> Exp <%'Response.Write GrantID & "<br>"%>
2
1952
by: milo1955 | last post by:
I have a form that passes a single variable via the GET function to a mysql databse query with the results paginated. The first page of the results work fine, but the link to the second page yields the page 2 results of the entire table. I'm guessing that the variable hasn't passed to page2 query? Please excuse my ignorance. Here's my code: <?php //where $rory is the variable that is passed via the form with the GET action $page = $_GET...
7
3352
by: EyeHawk | last post by:
Iím fairly new on ASP and Javascript programming, I have read as much as I can to develop my website in a user friendly manner. Iím using javascript to pass some values in a Form, but is no working, I have tried to research, but being such a specific problem I havenít being able to find any answers. Hope Somebody Can Help Me or put me in the right direction. Thanks in advance. I have a form and when clicking on an image all Iím trying to do...
0
9856
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9698
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10911
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10589
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5683
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4494
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4066
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3136
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.