Form Input Value to change a later value

Discussion in 'Javascript' started by Christa Lee, Oct 1, 2005.

  1. Christa Lee

    Christa Lee Guest

    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
     
    Christa Lee, Oct 1, 2005
    #1
    1. Advertisements

  2. Christa Lee

    Randy Webb Guest

    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
     
    Randy Webb, Oct 1, 2005
    #2
    1. Advertisements

  3. Christa Lee

    Lee Guest

    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?
     
    Lee, Oct 1, 2005
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Li Zhang
    Replies:
    4
    Views:
    6,403
    softip
    Feb 27, 2009
  2. ashutosh
    Replies:
    3
    Views:
    9,239
    Andrew Thompson
    Jun 16, 2005
  3. paulcis
    Replies:
    2
    Views:
    663
    paulcis
    May 11, 2007
  4. Matt Herson
    Replies:
    8
    Views:
    546
    Matt Herson
    Sep 30, 2003
  5. Susan Cranford
    Replies:
    2
    Views:
    587
  6. TeknoShock
    Replies:
    1
    Views:
    252
  7. RCGUA
    Replies:
    0
    Views:
    281
    RCGUA
    Oct 2, 2009
  8. RCGUA
    Replies:
    6
    Views:
    903
    Thomas 'PointedEars' Lahn
    Oct 3, 2009
Loading...