View | Details | Raw Unified | Return to bug 10310
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/prevent_submit.js (-18 / +10 lines)
Lines 1-18 Link Here
1
var prevent_nav = window.Event ? true : false;
1
$(document).ready(function() {
2
if (prevent_nav) {
2
  // We don't want to apply this for the search form
3
    window.captureEvents(Event.KEYDOWN);
3
  $("#doc3 form").keypress(function (e) {
4
    window.onkeydown = NetscapeEventHandler_KeyDown;
4
    if( e.which == 13
5
} else {
5
        && e.target.nodeName == "INPUT"
6
    document.onkeydown = IEEventHandler_KeyDown;
6
        && $(e.target).attr('type') != "submit"
7
}
7
    ) {
8
9
function NetscapeEventHandler_KeyDown(e) {
10
    if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; }
11
    return true;
12
}
13
14
function IEEventHandler_KeyDown() {
15
    if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
16
        return false;
8
        return false;
17
    return true;
9
    }
18
}
10
  });
11
});
19
- 

Return to bug 10310