Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Clear text area with button click

Reply
Thread Tools

Clear text area with button click

 
 
Targa
Guest
Posts: n/a
 
      11-04-2003
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



 
Reply With Quote
 
 
 
 
Mikhail Esteves
Guest
Posts: n/a
 
      11-04-2003
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 = '';">

 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-07-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fire both event button click and textchanged when button is click and text is changed Amy ASP .Net 0 06-01-2006 02:33 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 AM



Advertisments