Bugzilla – Attachment 18316 Details for
Bug 10310
Prevent submit form pressing enter should be improved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10310: Prevent submitting form with enter does not work with IE
Bug-10310-Prevent-submitting-form-with-enter-does-.patch (text/plain), 1.73 KB, created by
Marcel de Rooy
on 2013-05-22 14:01:07 UTC
(
hide
)
Description:
Bug 10310: Prevent submitting form with enter does not work with IE
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-05-22 14:01:07 UTC
Size:
1.73 KB
patch
obsolete
>From 616b69a7f83dc00adfff18abf485e8459742335b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 22 May 2013 15:49:26 +0200 >Subject: [PATCH] Bug 10310: Prevent submitting form with enter does not work > with IE >Content-Type: text/plain; charset=utf-8 > >I am not able to test this patch with IE... >I tested it with Chromium and FF and it works great. > >This patch can be tested on the neworderempty.pl page > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested with FF and IE. Works for both. >--- > .../intranet-tmpl/prog/en/js/prevent_submit.js | 25 ++++++------------- > 1 files changed, 8 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/prevent_submit.js b/koha-tmpl/intranet-tmpl/prog/en/js/prevent_submit.js >index bafd42a..541e562b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/prevent_submit.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/prevent_submit.js >@@ -1,18 +1,9 @@ >-var prevent_nav = window.Event ? true : false; >-if (prevent_nav) { >- window.captureEvents(Event.KEYDOWN); >- window.onkeydown = NetscapeEventHandler_KeyDown; >-} else { >- document.onkeydown = IEEventHandler_KeyDown; >-} >- >-function NetscapeEventHandler_KeyDown(e) { >- if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; } >- return true; >-} >- >-function IEEventHandler_KeyDown() { >- if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit') >+$(document).ready(function() { >+ // We don't want to apply this for the search form >+ $("#doc3 form").keypress(function (e) { >+ if( e.which == 13 >+ && e.target.nodeName != "TEXTAREA" ) { > return false; >- return true; >-} >+ } >+ }); >+}); >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10310
:
18314
|
18316
|
18317
|
18324
|
18326
|
18329
|
18330