2 * Allows moving around inputs/select by Ctrl+arrows
4 * @param object event data
6 function onKeyDownArrowsHandler(e
) {
8 var o
= (e
.srcElement
||e
.target
);
10 if (o
.tagName
!= "TEXTAREA" && o
.tagName
!= "INPUT" && o
.tagName
!= "SELECT") return;
11 if (navigator
.userAgent
.toLowerCase().indexOf('applewebkit/') != -1) {
12 if (e
.ctrlKey
|| e
.shiftKey
|| !e
.altKey
) return;
14 if (!e
.ctrlKey
|| e
.shiftKey
|| e
.altKey
) return;
18 var pos
= o
.id
.split("_");
19 if (pos
[0] != "field" || typeof pos
[2] == "undefined") return;
21 var x
= pos
[2], y
=pos
[1];
23 // skip non existent fields
26 if (switch_movement
) {
28 case 38: x
--; break; // up
29 case 40: x
++; break; // down
30 case 37: y
--; break; // left
31 case 39: y
++; break; // right
36 case 38: y
--; break; // up
37 case 40: y
++; break; // down
38 case 37: x
--; break; // left
39 case 39: x
++; break; // right
44 var id
= "field_" + y
+ "_" + x
;
45 var nO
= document
.getElementById(id
);
47 var id
= "field_" + y
+ "_" + x
+ "_0";
48 var nO
= document
.getElementById(id
);
55 if (nO
.tagName
!= 'SELECT') {
58 e
.returnValue
= false;