This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Keyboard Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Keyboard "Enter" doesn Watch "Keyboard "Enter" doesn New topic

Keyboard "Enter" doesn't work.

Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Hey everyone!

This may seems fairly rudimentary, but has me stumped right now. We have a bunch of JSP pages, which render HTML to the browser ofcourse. Intially, when the user pressed the "ENTER" key on the keyboard, the form was always submitted. But then we made some changes to the JSPs and I think we broket it at that point. Now the keyboard "Enter" does not work, and the user has to use to mouse to click on the "Enter" button on the page, which is annoying to some users.

Thereason for the changes are as follows... Basically,some transactions take a little longer to process . We had some impatient users submitting the form multiple times to get a response and hence double-posting transactions. TO avoid that, we put in som Javascript which disabled all the buttons on the page until they got a response back. I think thats where we broke something. THe code is as follows....

Any advise on how to enable our Keyboard Enter Key will be greatly appreciated.

Thanks much!

PS --> I did search this forum for solutions with out much luck.
Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Sorry, I forgot to post my my changes that I made to the page as mentioned in my original post.

Here they are-

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>Test Page</title>

<LINK rel=stylesheet href="../admin.css">

function functionkey(k){
if (k == "&")
} else {

<body bgcolor= "#faebd7">

<basefont size="1" face="Times Roman" />
<jsp:useBean id="PR004C" class="" scope="request"></jsp:useBean>
<FORM METHOD="post" NAME=Form1 ACTION="/servlet/PR004S">

<TD> <INPUT TYPE="button" TITLE="Exit" NAME="PF3" ID="PF3" VALUE="F3" onSlick="functionkey('3');" > </TD>

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63354

Is there a submit button in the form? Not just any button, but one that has submit semantics. For example an <input> or <button> with type of "submit".

If not, the enter key generally does not cause the form to submit itself.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Veni Velkoor
Ranch Hand

Joined: Oct 17, 2001
Posts: 65
Duh!! :-)

Thanks Bear!!

Sometimes a second set of eyes help a lot.... it is funny how one misses the very obvious while they are staring right at it.

Thanks a bunch again. Have a great weekend!
I agree. Here's the link:
subject: Keyboard "Enter" doesn't work.
It's not a secret anymore!