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

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

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

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. paulcis
    Replies:
    2
    Views:
    530
    paulcis
    May 11, 2007
  2. Scott

    store value for later use

    Scott, Feb 27, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    401
    Scott
    Feb 27, 2008
  3. Susan Cranford
    Replies:
    2
    Views:
    403
  4. RCGUA
    Replies:
    0
    Views:
    207
    RCGUA
    Oct 2, 2009
  5. RCGUA
    Replies:
    6
    Views:
    646
    Thomas 'PointedEars' Lahn
    Oct 3, 2009
Loading...

Share This Page