javascript question

Discussion in 'Software' started by unclematty, Feb 2, 2004.

  1. unclematty

    unclematty Private First Class

    Im trying to get the value of a text box upon clicking a button

    <form name="frm" method="post" action="default.aspx" id="frm">
    <INPUT type="amount" value=1" onclick="this.value='';">
    <INPUT type="button" value="Lookup" onclick="alert (document.frm.amount.value);">
    </form>

    any help? i keep getting not an object or null errors.
     
  2. Kodo

    Kodo SNATCHSQUATCH

    your TYPE for "AMOUNT" should be TEXT .. your name of that form element should be amount.

    <form name="frm" method="post" action="default.aspx" id="frm">
    <INPUT type="text" name="amount" value=1" onclick="this.value='';">
    <INPUT type="button" value="Lookup" onclick="alert (document.frm.amount.value);">
    </form>
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds