https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15855

--- Comment #1 from Arthur Suzuki <[email protected]> ---
Here is the code designed by Olivier :

// multi soumission Enter
var submitted;
$('#translControl1').bind('keyup',function() {
    submitted = false;
});  
$('#translControl1').bind('keydown',function(event) {
       code = event.keyCode||event.which||event.charCode||event.char||0;
       if(code == 13) {
           if (submitted == false) {
               submitted = true;                   
               $('#searchform').submit();
           } else {
               event.preventDefault();
               event.returnValue = false;
               return false;
           }
       }
});

The use of keyCode permits to submit form only once, and only uppon key down
event.
It prevents the users to fire multiple searches while holding the "Return" key
down (a behavior which is still possible with previously shared code).

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to