PC Review


Reply
Thread Tools Rate Thread

Avoid Enter key during insert entry

 
 
David C
Guest
Posts: n/a
 
      15th Oct 2009
I have a ListView for view/add/edit of a table. If I accidentally hit the
Enter key while entering data the page jumps to the submit page. Is there a
way to disable the Enter key to avoid this from happening? Thanks.

David


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      16th Oct 2009
On Oct 15, 10:06*pm, "David C" <dlch...@lifetimeinc.com> wrote:
> I have a ListView for view/add/edit of a table. If I accidentally hit the
> Enter key while entering data the page jumps to the submit page. Is therea
> way to disable the Enter key to avoid this from happening? *Thanks.
>
> David


<input type="text" onkeypress="return handleEnter(this, event)">

and in js

function handleEnter(field, event) {
var keyCode = event.keyCode ? event.keyCode :
event.which ? event.which : event.charCode;
if (keyCode == 13) {
event.returnValue = false;
event.cancel = true;
}
else
return true;
}
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Avoid enter parameter value =?Utf-8?B?Q2FybG9zIFNhbnRvcw==?= Microsoft Access Reports 1 16th Oct 2005 04:13 PM
Avoid user having to enter hours when using [mm]:ss format =?Utf-8?B?TGFkeV9sdWNr?= Microsoft Excel Misc 3 4th Jan 2005 10:50 AM
Avoid user having to enter 00 hours when using [mm]:ss format =?Utf-8?B?TGFkeSBMdWNr?= Microsoft Excel Misc 4 2nd Jan 2005 06:56 PM
Avoid duplicate entry dawn Microsoft Access Queries 1 25th Feb 2004 03:28 PM
Avoid enter key press to submit form huan Microsoft Dot NET 0 18th Nov 2003 09:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:36 PM.