Locked

Acrobat Javascript help

Community Beginner ,
May 14, 2022 May 14, 2022

Copy link to clipboard

Copied

Hello,

 

I'm trying to create a form wich include couple variable like age, date of birth and gender.

We use a id number made of 4 letters ans 8 digits, made of:

3 first letter of last name 1st letter of first name;

Digits represent YY MM* DD and 2 administrative numbers

example John Doe born janurary 20th of 1988  would be DOEJ 8801 2013

* female see month added of 50, eg; Janurary = 51 until december = 62

Example Sarah Andrews born october 13th of 1990 would be ANDS 9061 1312

I was able to calculate a script wich generale a date of birth only for male and i tried verry hard to do it with females too but I'm not enough confortable with scripting. 

I'm also unsure how to deal with the years of Y2K but I could deal with it after 😅 (i guess it's in the 2 last digits, but cannot see any difference in numbers of 19' and 20' folks..)

 

Thanks a lot.

 

PS: using Acrobat Pro 2017 on MacOs

 

TOPICS
General troubleshooting , JavaScript , PDF forms

Views

38

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 16, 2022 May 16, 2022

Likes

Translate

Translate
Community Expert ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

Post your current code, please.

There's no solution to the years issue, though. Your code is susceptible to the Y2K-bug. You can't know if someone was born on 1920, or on 2020. If this is something you can control I strongly recommend switching to a full year representation, using 4 digits.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2022 May 16, 2022

Copy link to clipboard

Copied

LATEST

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines