Copy link to clipboard
Copied
What I am trying to do is use part of a field that is filled in by a user to fill in another field. The two examples I am looking at working with are social security numbers and dates.
I have one field that the user inputs the full social security number into. On other pages, I only need the last four digits of the number. Is there a way that this can be done?
My second one is a date that is inputted by the user in a YYYYMMDD format. Some of the pages need each digit added to a single charter block and some of them need a date that takes up two lines, year on top and month date below. Is there a way either of those can be done?
My experience with Java is very limited so I would prefer to be pointed in the direction so I can learn the info over just being given the answer if possible.
What you need is a regular expression. Regular expressions are a very popular tool for parsing strings.
Here's an article on the topic:
https://acrobatusers.com/tutorials/text-matching-regular-expressions
But, the string parsing you've mentioned are pretty simple. You could also use simpler sting manipulation operations.
Here's on article on that topic:
https://acrobatusers.com/tutorials/splitting-and-rebuilding-strings
Copy link to clipboard
Copied
What you need is a regular expression. Regular expressions are a very popular tool for parsing strings.
Here's an article on the topic:
https://acrobatusers.com/tutorials/text-matching-regular-expressions
But, the string parsing you've mentioned are pretty simple. You could also use simpler sting manipulation operations.
Here's on article on that topic:
https://acrobatusers.com/tutorials/splitting-and-rebuilding-strings
Copy link to clipboard
Copied
It's also very important to know that what you're using is called JavaScript, not Java. Similar names, but very different languages.
Copy link to clipboard
Copied
try67 wrote
It's also very important to know that what you're using is called JavaScript, not Java. Similar names, but very different languages.
Thanks for that, that will teach me not to proof read before I hit submit