This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Keyboard "Enter" doesn't work.

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic