Simple javascript multiplication help needed.

Discussion in 'JavaScript' started by KingCobra, Apr 16, 2011.

  1. #1
    Simple javascript multiplication code needed.
    Bellow is my form.

    What is needed:
    If I put 2 in first textbox then it will calculate immediately (on fly) the total in second textbox (that means 105.00 in second textbox).

    <form method="POST" action="--WEBBOT-SELF--">
      <input type="text" name="T1" size="5"> x $52.50 =
      <input type="text" name="T2" size="10"> <br>
      <br>
      
      <input type="submit" value="Submit" name="B1">
      <input type="reset" value="Reset" name="B2">
    </form>
    HTML:
    PLEASE HELP ME
     
    KingCobra, Apr 16, 2011 IP
  2. Jan Novak

    Jan Novak Peon

    Messages:
    121
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    0
    #2
    
        <form method="POST" action="--WEBBOT-SELF--">
      <input type="text" name="T1" size="5" onkeyup="this.form.T2.value=parseFloat(this.value*52.5)"> x $52.50 =
      <input type="text" name="T2" size="10" id="T2"> <br>
      <br>
    
      <input type="submit" value="Submit" name="B1" >
      <input type="reset" value="Reset" name="B2">
    </form>
    
    Code (markup):
     
    Jan Novak, Apr 16, 2011 IP
  3. KingCobra

    KingCobra Well-Known Member

    Messages:
    289
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Jan Novak,
    Thank you very much. It works. THANK YOU
     
    KingCobra, Apr 16, 2011 IP