Form Input Value to change a later value

C

Christa Lee

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
 
R

Randy Webb

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.
 
L

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?
 

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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top