Clear text area with button click

Discussion in 'Javascript' started by Targa, Nov 4, 2003.

  1. Targa

    Targa Guest

    How can I clear a text field by clicking on a button?

    Ive searched the web and found tons of scripts that will clear text just
    entered but I am displaying results from a database into a text area field.
    I need to be able to click a button and clear the field completely - not
    just the text that was just entered.

    BTW - There is only one field on the form so a routine that will clear an
    entire form would work.

    TIA
    Targa, Nov 4, 2003
    #1
    1. Advertising

  2. Targa, on Tue, 04 Nov 2003 01:38:54 -0600, had to say:

    > How can I clear a text field by clicking on a button?


    <input type="button" value="Clear"
    onlick="document.formname.textareaname.value = '';">
    Mikhail Esteves, Nov 4, 2003
    #2
    1. Advertising

  3. Mikhail Esteves wrote:

    > Targa, on Tue, 04 Nov 2003 01:38:54 -0600, had to say:
    >> How can I clear a text field by clicking on a button?

    >
    > <input type="button" value="Clear"
    > onlick="document.formname.textareaname.value = '';">


    <input
    type="button"
    value="Clear"
    onlick="this.form.elements['textareaname'].value = '';">


    PointedEars
    Thomas 'PointedEars' Lahn, Nov 7, 2003
    #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. Purvi T
    Replies:
    0
    Views:
    830
    Purvi T
    Oct 19, 2004
  2. Amy
    Replies:
    0
    Views:
    976
  3. weiwei
    Replies:
    3
    Views:
    198
    Brynn
    Jan 7, 2004
  4. leo
    Replies:
    1
    Views:
    275
    Bob Lehmann
    Dec 5, 2005
  5. Matt
    Replies:
    5
    Views:
    159
    Matt Kruse
    May 27, 2004
Loading...

Share This Page