Skip to main content
johnnyZ
Inspiring
April 30, 2023
Answered

Adobe Acrobat "Generic" Fill-in Form Question.

  • April 30, 2023
  • 3 replies
  • 3454 views

I have been creating "fill-in" forms using ADOBE ACROBAT 9.0 Standard.

This most recent form I'm working on requires a "Date of Birth" field, and an "Age" field.

I decided to calculate the Age field from the Date of Birth field, and therefore make the Age field "Read Only".

Now, as I enter data, any data, into the form, it seems "slower" and, a tiny little keyboard image appears briefly right next to my mouse pointer.

Is that because of the calculation for the Age from the Date of Birth

Does it calculate the Age EVERY time I enter any data into the form?

Even if I click on a "check box", that “little keyboard” pops up!

I’m not so bothered by the “slower-ness”, but is there any way to prevent that “little keyboard” from popping up?  

This topic has been closed for replies.
Correct answer Nesa Nurani

Thanks Nesa, but, the form has a "Date of Birth" field.

I'd like it to calculate the person's Age using the date entered in that field.

I don't know how to write these scripts, but I don't see anywhere where it's using the date in the "Date of Birth" field.


Script uses date entered into "Date of Birth" field and current date and show ages in "Age" field.

3 replies

JR Boulay
Community Expert
Community Expert
May 2, 2023

Acrobat 9.0 is buggy.

You should update to the latest version: 9.5.5

Acrobate du PDF, InDesigner et Photoshopographe
johnnyZ
johnnyZAuthor
Inspiring
April 30, 2023

Thanks for your quick reply.

Here is the script that I am currently using, BUT it is in the CALCULATE - Custom Calculation Script.

Woud I use the same script in the Run Custom Validation Script section?

event.value = "";
var dobValue = getField("Date of Birth").value;
if (dobValue!="") {
var dob = util.scand("mm/dd/yyyy", dobValue);
var today = new Date();
var age = today.getFullYear() - dob.getFullYear();
if (today.getMonth() < dob.getMonth()) age = age - 1;
if ((today.getMonth() == dob.getMonth()) && (today.getDate() < dob.getDate())) age -= 1;
event.value = age;
}

If not, can you please help me with the script?

 

 

Bernd Alheit
Community Expert
Community Expert
May 2, 2023

At validation the date of birth is in event.value

Bernd Alheit
Community Expert
Community Expert
April 30, 2023

"Does it calculate the Age EVERY time I enter any data into the form?"

 

Yes. You can avoid this when you use a validation script at the date field and calculate the age there.