PDA

View Full Version : How to reset only <textarea> not entire form


Deanna475
05-01-2003, 09:57 AM
Hi all. I'm working on a somewhat lengthy form and there is one <textarea> in particular where a user may change their mind as they enter the info, especially since there is a max length / character counter involved. The user may want to simply start typing their info over again and, in this regard, how do I set it up so that only this one textarea resets, not the entire form? I'm using images for "send" and "reset" at the bottom of the form, so if it makes a difference to the coding, I'd prefer to use an image button. If not, I can deal with it. *S*

Any and all feedback is appreciated.

x_goose_x
05-01-2003, 01:04 PM
<img src="reset.gif" onClick="document.FormName.TextName.value='';">

ex:

<form name="myform3" action="next.htm" method="POST">
<textarea name="myTxt"></textarea>
</form>

<img src="reset.gif" onClick="document.myform3.myTxt.value='';">

Deanna475
05-01-2003, 08:04 PM
Brilliant !! Works like magic !! :thumbsup:

Thanks, Goose. Much appreciated.

Deanna