473,320 Members | 1,828 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,320 software developers and data experts.

Passing variable from HREF to form field on another page

21
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="javascript:newWindow1('issue01dp.html')">Iss ue 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 3695
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
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:...
6
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...
1
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...
6
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 =...
4
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...
5
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...
2
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...
7
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,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.