File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Stop Textfield from Going Blank Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Stop Textfield from Going Blank" Watch "Stop Textfield from Going Blank" New topic

Stop Textfield from Going Blank

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1559
I have a form on my JSP with a textfield and to buttons. Each button fires separtate javascripts. When a user types text in to the box and then presses the keyboard enter key the text in the box disappears. How can I keep this from happening?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63547

Is the enter key initiating a form submission?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Stop Textfield from Going Blank
It's not a secret anymore!