help with this..

Discussion in 'JavaScript' started by cris02, Nov 12, 2009.

  1. #1
    I'm just want to get the current value of a textfield.
    
    <input type="text" name="gname" value="new" />
    <input name="new_mail" type="button" id="new_mail" class="btn" value="CREATE NEW MAIL" onclick="javascript: 'new_mail.php?gpname={[B]GET THE VALUE OF TEXTFIELD NAMED "gname"[/B]}
    
    Code (markup):

     
    cris02, Nov 12, 2009 IP
  2. hdewantara

    hdewantara Well-Known Member

    Messages:
    540
    Likes Received:
    47
    Best Answers:
    25
    Trophy Points:
    155
    #2
    Supply an ID to text type input named "gname",
    and get its value by function document.getElementById("gname").value ?

    Hendra D.
     
    hdewantara, Nov 13, 2009 IP