Using Acrobat Action Wizard to auto-tab to next field
I’m trying to speed up the process of creating an interactive pdf form in Adobe Acrobat through Action Wizard using Javascript, as I use and change the forms many times a day. I’m struggling to make the auto tab work through Action Wizard – I have some fields that require only one number and I like it to automatically go to the next field once that number is entered. Example of some of the code I currently use in Action Wizard:
for (var i = 0; i < numFields; i++) {
var fName = getNthFieldName(i);
var f = getField(fName);
var fTool = getNthFieldName(i).userName;
if (fName == "C1”) {
f.charLimit = 1;
f.alignment = "center";
f.setAction("Keystroke", "AFNumber_Keystroke\(0, 0, 0, 0, \"\", false\);");
}
if (fName =="C2”) {
f.charLimit = 1;
f.alignment = "center";
f.setAction("Keystroke", "AFNumber_Keystroke\(0, 0, 0, 0, \"\", false\);");
}
}
So I would like C1 to have some code that automatically goes to C2. Is there any way this is possible with just Action Wizard? Currently I’ve been doing it manual using:
function tab_next(next_field_name) {
if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) {
getField(next_field_name).setFocus();
}
}
And the Keystroke script:
tab_next(“C2”);
If anyone knows a way to do this, that would be much appreciated. Thanks!