473,405 Members | 2,310 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,405 software developers and data experts.

Form Input Value to change a later value

Hi there,
The title probably doesn't really make sense, but here's the explanation:

I'm using paypal to take credit card payments on my web site. Now I have a
field labeled "Quantity"

<input name="Quantity" type="text" size="5">

and I would like the number that the user types into this field to be echoed
to

<input type="hidden" name="add" value="USERSVALUE">

I'm really green when it comes to Javascript, but I am pretty fluent in PHP
:-s. I don't think I can do it in PHP because PHP would be able to change
the value on the same page without something being submitted (am I wrong
here?).

Thanks in advance!
Dimitri Marshall
www.toquewear.com
Oct 1 '05 #1
2 1541
Christa Lee said the following on 10/1/2005 1:12 AM:
Hi there,
The title probably doesn't really make sense, but here's the explanation:

I'm using paypal to take credit card payments on my web site. Now I have a
field labeled "Quantity"

<input name="Quantity" type="text" size="5" >
onchange="document.forms['formName'].elements['add'].value=this.value;"

Or, have an onsubmit handler that before the form gets submitted, you
set the hidden field.

But, is this the Paypal form or a form of your own?

If it is a form of your own, then you can simply have PHP duplicate it
on the server after submission.

and I would like the number that the user types into this field to be echoed
to

<input type="hidden" name="add" value="USERSVALUE">

I'm really green when it comes to Javascript, but I am pretty fluent in PHP
:-s. I don't think I can do it in PHP because PHP would be able to change
the value on the same page without something being submitted (am I wrong
here?).


I think you meant "PHP wouldn't be able to" instead, and the answer then
is no.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 1 '05 #2
Lee
Christa Lee said:

Hi there,
The title probably doesn't really make sense, but here's the explanation:

I'm using paypal to take credit card payments on my web site. Now I have a
field labeled "Quantity"

<input name="Quantity" type="text" size="5">

and I would like the number that the user types into this field to be echoed
to

<input type="hidden" name="add" value="USERSVALUE">

I'm really green when it comes to Javascript, but I am pretty fluent in PHP
:-s. I don't think I can do it in PHP because PHP would be able to change
the value on the same page without something being submitted (am I wrong
here?).


Is there a really good reason why you need the same value to be submitted as
"Quantity" and as "USERSVALUE"? What happens is a customer doesn't have
Javascript enabled?

Oct 1 '05 #3

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

Similar topics

2
by: iwasinnihon | last post by:
I don't usually like to do this, but I need help. I have gone over this code and cannot figure out why it doesn't work. First of all it doesn't check to see if you have filled in the required...
3
by: dave | last post by:
Hi, I know i shouldn't work on php forms when i'm going on 30 hours of no sleep, but i did anyway. I'm trying to get the below to work, and i keep getting a parse error line 74, an unexpected ','...
7
by: Old Lady | last post by:
Hi all, I have a problem when I try to send an array using a form when the type="checkbox". This is my form input row: <INPUT type="Checkbox" name="flg" value="y" <? if($row == 'y') echo...
6
by: Kevin Ingram | last post by:
Ok, this is probably a silly question but I just keep hitting a brick wall here. I usually develop my sites entirely in ASP and use a database for data storage, works great for me. I also...
10
by: Steve Benson | last post by:
Our regular programmer moved on. I'm almost clueless in Javascript/ASP and got the job of adapting existing code. In the page below, everything works until I added the function checkIt() to...
6
by: drec | last post by:
I am just learning Javascript and I would like to create a basic form that gives me two options. This will be using either checkbox or radio input type, however I would like the second option to...
4
by: Mangler | last post by:
Without writing a bible on what I'm trying to do I'll see if someone can answer a quick question. I have a form that the user writes a value in a test field. I need to put a hidden value that...
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
7
by: pooba53 | last post by:
I am working with VB .NET 2003. Let's say my main form is called Form1. I have to launch a new form (Form2) that gathers input from the user. How can I pass variable information back to Form1...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.