Skip to main content
Inspiring
May 14, 2022
Answered

Acrobat Javascript help

  • May 14, 2022
  • 2 replies
  • 416 views

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

 

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertCorrect answer
Community Expert
May 16, 2022
try67
Community Expert
Community Expert
May 16, 2022

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.