Want to do this please help

Discussion in 'HTML & Website Design' started by Jeehan, Mar 16, 2010.

  1. #1
    here what i want to do, im not a coder so please help,

    i will have some buttons, each button will have different value, and there will be one text box. when ever any button is clicked the button's value will show in text box.
     
    Jeehan, Mar 16, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Here is a simple script to do it:

    
    <html>
    
    <head>
      <title>Buttons</title>
    </head>
    
    <body>
    
    <input type="button" value="Button1" onclick="document.getElementById('textbox').value = this.value" /> <input type="button" value="Button2" onclick="document.getElementById('textbox').value = this.value" /> <input type="button" value="Button3" onclick="document.getElementById('textbox').value = this.value" />
    
    <p><textarea id="textbox" cols="30" rows="5"></textarea></p>
    
    </body>
    
    </html>
    
    Code (markup):
     
    s_ruben, Mar 16, 2010 IP
  3. amber1003

    amber1003 Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    not bad, learning
     
    amber1003, Mar 17, 2010 IP
  4. katariyaprince

    katariyaprince Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    keep it up learning!!!!!!!!!!!!!!
     
    katariyaprince, Mar 17, 2010 IP
  5. Jeehan

    Jeehan Well-Known Member

    Messages:
    1,578
    Likes Received:
    31
    Best Answers:
    1
    Trophy Points:
    115
    #5
    Thank you s_ruben
     
    Jeehan, Mar 18, 2010 IP
  6. guardian999

    guardian999 Well-Known Member

    Messages:
    376
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #6
    keep learning
     
    guardian999, Mar 18, 2010 IP