Copy link to clipboard
Copied
Hello, I'm relatively new to JavaScript and any help is greatly appreciated.
I have a form with multiple columns that a user will be filling out. The columns need to be filled out top to bottom. I would like to use the ENTER key to move to the next field in the column. I am aware that the TAB key is the default choice of Adobe, but it is not a logical choice for the users that will be using this form. Currently I have been using the script below to move from the first text field to the second. Is there a way for me to apply this script to the enite column without having to place the script in each text field's Custom Keystroke script area? I am using Adobe Acrobat Pro 2017 Thanks.
if (event.commitKey === 2) {
getField("Plant Sample Row2").setFocus();
}
Kind of. What you can do is put it in a doc-level function and then call it from each field, but you'll still have to specify the name of the next field as parameter. For example, the generic function would be:
function goToNext(fieldName) {
if (event.commitKey === 2) {
this.getField(fieldName).setFocus();
}
}
And then you call it like this:
goToNext("Plant Sample Row2");
Copy link to clipboard
Copied
Hello, I'm relatively new to JavaScript and any help is greatly appreciated.
I have a form with multiple columns that a user will be filling out. The columns need to be filled out top to bottom. I would like to use the ENTER key to move to the next field in the column. I am aware that the TAB key is the default choice of Adobe, but it is not a logical choice for the users that will be using this form. Currently I have been using the script below to move from the first text field to the second. Is there a way for me to apply this script to the enite column without having to place the script in each text field's Custom Keystroke script area? I am using Adobe Acrobat Pro 2017 Thanks.
if (event.commitKey === 2) {
getField("Plant Sample Row2").setFocus();
}
Kind of. What you can do is put it in a doc-level function and then call it from each field, but you'll still have to specify the name of the next field as parameter. For example, the generic function would be:
function goToNext(fieldName) {
if (event.commitKey === 2) {
this.getField(fieldName).setFocus();
}
}
And then you call it like this:
goToNext("Plant Sample Row2");
Copy link to clipboard
Copied
Kind of. What you can do is put it in a doc-level function and then call it from each field, but you'll still have to specify the name of the next field as parameter. For example, the generic function would be:
function goToNext(fieldName) {
if (event.commitKey === 2) {
this.getField(fieldName).setFocus();
}
}
And then you call it like this:
goToNext("Plant Sample Row2");
Copy link to clipboard
Copied
Thank you.
Copy link to clipboard
Copied
Hi, try67.
Is there a way to simulate the tabkey (script) whent the name of the next field in unknown?
No matter where the cursor is, I would like the script to move to the next field, as if I was using the tab key
Copy link to clipboard
Copied
No.
Copy link to clipboard
Copied
i'm sad to read that 🙂
Thank you for your answer.