1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
|
<script language="JavaScript" type="text/javascript">
function CodeNext (num) {
var event = window.event;
var code = event.which;
if (num == 1) {
if (document.forms[0].key1.value.length == 6) {
if ((code != 37) && (code != 39)) {
document.forms[0].key2.focus();
}
else if ((code == 39) && (document.forms[0].key1.selectionStart == 6) && (document.forms[0].key1.selectionEnd == 6)) {
document.forms[0].key2.focus();
}
}
}
else if (num == 2) {
if (document.forms[0].key2.value.length == 4) {
if ((code != 37) && (code != 39)) {
document.forms[0].key3.focus();
}
else if ((code == 39) && (document.forms[0].key2.selectionStart == 4) && (document.forms[0].key2.selectionEnd == 4)) {
document.forms[0].key3.focus();
}
}
else if ((document.forms[0].key2.selectionStart == 0) && (document.forms[0].key2.selectionEnd == 0)) {
if (code == 37) {
document.forms[0].key1.focus();
}
}
}
else {
if (document.forms[0].key3.selectionStart == document.forms[0].key3.selectionEnd) {
if (document.forms[0].key3.selectionStart == 0) {
if (code == 37) {
document.forms[0].key2.focus();
}
}
}
}
}
</script>
|