Copy link to clipboard
Copied
I am trying to create an Adobe form for use in a mailroom for package tracking numbers. The person using the form will utilize a barcode scanner to receive packages from all different carriers (FedEx, UPS, USPS etc)
When scanning the barcode on a FedEx label, it populates a 34 digit string of numbers where only the last 12 digits are the actual tracking number. I would like to use some sort of script within certain text fields to remove the first 22 digits (and only display the last 12). I am a novice with Javascript and any help is much appreciated.
In addition, if there is a way to use part of the number sequence to identify between FedEx Ground and FedEx Express, that would be awesome
The question is whether the scan process triggers the normal events that are triggered when entering a value into a field.
If so, you can do it using this code as the field's custom calculation script:
if (event.value) event.value = event.value.substr(-12);
What do you mean by normal events? The plan is that the scanner will input the numeric sequence of the barcode followed by a tab key to advance to the next field.
Copy link to clipboard
Copied
The question is whether the scan process triggers the normal events that are triggered when entering a value into a field.
If so, you can do it using this code as the field's custom calculation script:
if (event.value) event.value = event.value.substr(-12);
Copy link to clipboard
Copied
What do you mean by normal events? The plan is that the scanner will input the numeric sequence of the barcode followed by a tab key to advance to the next field.
Copy link to clipboard
Copied
Just try it and see if it works.
Copy link to clipboard
Copied
It worked perfectly, thank you