Copy link to clipboard
Copied
Good Afternoon Community 🙂
I am trying to create a form in Adobe Acrobat Pro DC. So far this has been pretty successful.
The next thing I am trying to achieve is that when I enter my asset number into the field using a barcode scanner, that it will go to the next field for the secondary barcode to be scanned.
The very next field is for notes so what I would like, is to do some code that will allow for me to click in the first asset number box, scan the barcode and have it automatically move onto the next field. The barcode numbers are limited to 6 digits, so I have set each field to only accept 6 digits.
Heres the thing- I have basically no knowledge of JavaScript so have had no luck in getting any of the scripts to work. Does anyone have any ideas that might help me out?
Many Thanks in advance 🙂
Copy link to clipboard
Copied
Good Afternoon Community 🙂
I am trying to create a form in Adobe Acrobat Pro DC. So far this has been pretty successful.
The next thing I am trying to achieve is that when I enter my asset number into the field using a barcode scanner, that it will go to the next field for the secondary barcode to be scanned.
The very next field is for notes so what I would like, is to do some code that will allow for me to click in the first asset number box, scan the barcode and have it automatically move onto the next field. The barcode numbers are limited to 6 digits, so I have set each field to only accept 6 digits.
Heres the thing- I have basically no knowledge of JavaScript so have had no luck in getting any of the scripts to work. Does anyone have any ideas that might help me out?
Many Thanks in advance 🙂
Copy link to clipboard
Copied
The main question is whether the barcode scanner triggers any of the events normally associated with changing the value of a field. If not, then it's not possible to do that.
Copy link to clipboard
Copied
The only thing I can think that would trigger it is once it has reached 6 characters it moves to the next field? But being a beginner in the true sense of the word- I am unsure if this is really possible?
With the input from the scanner being automatic, could it be coded that if there is content in the field it skips to next? I'm not sure if it would only allow a small amount of the 6 numbers to be captured is the only thing.
Copy link to clipboard
Copied
It's certainly possible with a normal text field.
Copy link to clipboard
Copied
Could you explain to me the best way to acheive it with a normal text field?
I have tried some of the other code that I have found on other threads- but I think I must be missing something in my understanding as I cannot get it to come together. Thank you so much for your time- I really appreciate it.
Copy link to clipboard
Copied
I think most of the code out there relies on the character limit of the field. Did you make sure to set that?
Copy link to clipboard
Copied
I have limited the text box to 6 characters in the text box properties- but I didn't use combing (I believe that combing just distributes the numbers accross the field?)
Copy link to clipboard
Copied
No, combing is not needed. What code did you use?
Copy link to clipboard
Copied
I have found success 😄
This is what I used:
// Document-level function
function tab_next(next_field_name) {
// Move to next field if Enter key is pressed
// or the user has clicked outside of the field
// or if the number of character is the character limit
if (event.willCommit || AFMergeChange(event).length === event.target.charLimit) {
getField(next_field_name).setFocus();
}
}
Custom Keystroke script for text field:
// Autotab to the "text2" field
tab_next("text2");