Clear text area with button click

T

Targa

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
 
M

Mikhail Esteves

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 = '';">
 
T

Thomas 'PointedEars' Lahn

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

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

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


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top