Skip to main content
johnnyZ
Inspiring
February 8, 2024
Answered

Disable PDF Form field based on check box

  • February 8, 2024
  • 4 replies
  • 3047 views

First, I'm using Acrobat 9.0 Standard. (I know, I know, it's old.)  I can't afford the newer version.

 

I'm working on a medical form.   There's a question if you smoke, with check boxes Yes or No.

After that there are questions related to smoking, for example,

How many packs per day do you smoke?

How many years did you smoke?

What date did you quit smoking?

If the patient checks the NO box, can the form skip or "disable" the next 3 questions when they press the TAB key?

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

Thanks Nesa,

But now, once I place an "X" in the YES box, the TAB key doesn't move me to any fields.

I would have liked it to bypass the NO box and jump to the first smoking question.

No what?  I think I can live without this feature.

If the patient checks the YES box and presses the TAB key,  the "cursor" moves to the NO box, then another press of the TAB key to the first smoking question because they said, YES they are a smoker.

If the patient presses the TAB key and passes the YES box and checks the NO box and presses the TAB key, it skips the next 3 smoking related questions because they said, NO they are not a smoker.

Thanks for your help. I'm going to flag this RESOLVED.


If you set it correctly, it should set focus to whatever field you put in the script.

If it doesn't work correctly for you, share your file so we can see what exactly is going on.

4 replies

JR Boulay
Community Expert
Community Expert
February 9, 2024

This means that Adobe has disabled the update servers for Acrobat 9.
You'll need to download the installers to be able to install them.

Send me a private message if you want the URL.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
February 8, 2024

2.

Click the Help menu: Check for Updates

Acrobate du PDF, InDesigner et Photoshopographe
johnnyZ
johnnyZAuthor
Inspiring
February 8, 2024

When I click on Help and "Check for updates", I get this message:

JR Boulay
Community Expert
Community Expert
February 8, 2024

1.

Acrobate du PDF, InDesigner et Photoshopographe
johnnyZ
johnnyZAuthor
Inspiring
February 8, 2024

I understand the concept.

Here is the script I tried after I modified it".

if (event.target.value == "Off") {
this.getField("Tobacco_Packs_per_day").readonly = true;
this.getField("Tobacco_years_usage").readonly = true;
this.getField("Tobacco_Quit_Date").readonly = true;
}
else {
this.getField("Tobacco_Packs_per_day").readonly = false;
this.getField("Tobacco_years_usage").readonly = false;
this.getField("Tobacco_Quit_Date").readonly = false;
}

Before the Export values were YES=0, NO=1.

Now I changed the Export Value to No on the NO check box.

But now, I can select Both check boxes, YES and NO.

Before, with 0 + 1, it would only allow me to select either YES or NO.

Also, should I change OFF in the script to match the NO check box?

Do I insert the script onto both buttons?

In other words, does the "Off" in the script need to match the Export value from the NO check box?

I'm frustrated.

johnnyZ
johnnyZAuthor
Inspiring
February 9, 2024

Hey JR,

After some trial and error, error, error, I think I got it working.  Thank you.

One more question.

So there are 2 check boxes,  YES  and  NO

If the patient presses the TAB key to get to the NO box, and puts in a check mark, then it skips those 3 questions, but if the the patient checks the YES box, then hits the TAB key, it takes you to the NO box.

Is there a way to have the TAB key skip over the NO box if the YES box is already checked?

 

JR Boulay
Community Expert
Community Expert
February 8, 2024

Try this script (place it in the checkbox after adjusting the target field names):

if (event.target.value == "Off") {
this.getField("question1").readonly = true;
this.getField("question2").readonly = true;
this.getField("question3").readonly = true;
}
else {
this.getField("question1").readonly = false;
this.getField("question2").readonly = false;
this.getField("question3").readonly = false;
}

 

You should update your Acrobat to version 9.5 (the latest available).

Acrobate du PDF, InDesigner et Photoshopographe
johnnyZ
johnnyZAuthor
Inspiring
February 8, 2024
Hi JR,
OK, thank you for your answer, but please forgive my ignorance.
 
When I right click on the "No" checkbox, and choose Properties, I get a Properties window with 4 tabs.
General - Appearance - Options - Actions
I don't get a tab for Format, which, I think is where I need to enter your Custom Format Script.
Am I wrong?
 
Also, I've tried to find Version 9.5, but have been unsuccessful.
Can you guide me for the update?
Thanks, John