I am developing a maintain application and have some data entry screens where the user will be entering data at high speed.
Has anybody managed to create this behaviour within a Maintain application.
In this example, when the user enters a 5th character into the Moviecode field, the cursor is placed in the Title field. When he enters the 10 character into the Title field, the cursor goes to the Category field.
Place all of the fields, their lengths and tab order in this one file.
Please note, that in the below example, I enter OnKeyUp as OnKey_Up. I could not enter it without the underscore! Please remove it when you use the code!
// Limits input to n characters in Edit Boxes. After nth character is entered automatically set focus to next control
document.onkey_up = OnKeyUp;
var CurrentControl = document.activeElement.id;
var Box1Len = document.Form1.Moviecode_Edit.value.length;
var Box2Len = document.Form1.Title_Edit.value.length;
if ((CurrentControl == "Moviecode_Edit") && (Box1Len > 4))
var x = String(document.Form1.Moviecode_Edit.value).substr(0,5);
document.Form1.Moviecode_Edit.value = x;
else if ((CurrentControl == "Title_Edit") && (Box2Len > 9))
var y = String(document.Form1.Title_Edit.value).substr(0,10);
document.Form1.Title_Edit.value = y;
|Powered by Social Strata|