aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Any function can auto clear the text box? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Any function can auto clear the text box?" Watch "Any function can auto clear the text box?" New topic
Author

Any function can auto clear the text box?

Phoebe Song
Ranch Hand

Joined: Jan 17, 2002
Posts: 54
Hi I'm new to Javascript, right now I'm doing a project that when you click on the "new" button, the text in the text box and text area will disappear. Is there any javascript function can do the trick or should I coding myself? Thank you for your help.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

You'll pretty much have to do that yourself. You could use the built in reset() function, but that will return the form to it's original state. The problem with that is if you have the form populated with any data when the page loads, reset() will just put it back to that. If your form always starts completely blank, then you can probably get away with using reset() though.


GenRocket - Experts at Building Test Data
Phoebe Song
Ranch Hand

Joined: Jan 17, 2002
Posts: 54
Thank you very much.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Any function can auto clear the text box?