• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keyboard "Enter" doesn't work.

 
Veni Velkoor
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
Veni

PS --> I did search this forum for solutions with out much luck.
 
Veni Velkoor
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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">

<html>
<head>
<title>Test Page</title>

<LINK rel=stylesheet href="../admin.css">
<META HTTP-EQUIV="Pragma" CONTENT="No-Cache">

<SCRIPT LANGUAGE="JavaScript">
function functionkey(k){
if (k == "&")
{
document.Form1.c__Aid_I.value="'";
} else {
document.Form1.c__Aid_I.value=k;
}
document.Form1.Enter.disabled=true;
document.Form1.PF2.disabled=true;
document.Form1.PF3.disabled=true;
document.Form1.PF4.disabled=true;
document.Form1.PF5.disabled=true;
document.Form1.PF6.disabled=true;
document.Form1.PF7.disabled=true;
document.Form1.PF8.disabled=true;
document.Form1.PF9.disabled=true;
document.Form1.PF10.disabled=true;
document.Form1.PF11.disabled=true;
document.Form1.PF12.disabled=true;
document.Form1.submit();
}
</SCRIPT>

</head>
<body bgcolor= "#faebd7">

<basefont size="1" face="Times Roman" />
<jsp:useBean id="PR004C" class="com.xxx.clcs.test.PR004C" 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>
.
.


Thanks!
V
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Veni Velkoor
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
V
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic