fixed autocompletion in account lists

This commit is contained in:
Roland Gruber 2013-01-12 11:34:08 +00:00
parent 63ab02f5b5
commit 9a266f759b
1 changed files with 10 additions and 1 deletions

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2003 - 2012 Roland Gruber Copyright (C) 2003 - 2013 Roland Gruber
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -91,9 +91,18 @@ function SubmitForm(id, e) {
if (e.returnValue) { if (e.returnValue) {
e.returnValue = false; e.returnValue = false;
} }
if (window.lastKeyCode) {
// no submit if last key code was arrow key (browser autocompletion)
if (window.lastKeyCode == 33 || window.lastKeyCode == 34 ||
window.lastKeyCode == 38 || window.lastKeyCode == 40) {
window.lastKeyCode = e.keyCode;
return true;
}
}
document.getElementsByName(id)[0].click(); document.getElementsByName(id)[0].click();
return false; return false;
} }
window.lastKeyCode = e.keyCode;
return true; return true;
} }