• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to check the value of multiple check boxes when closing acrobat

Community Beginner ,
Oct 14, 2020 Oct 14, 2020

Copy link to clipboard

Copied

I would like to perform a check whenever the pdf is closed and display an alert if one of the check boxes in the document is not ticked.

My problem is that the validity of certain textboxes should be checked in connection with the value selected in a specific radio button. 

I thought to use this code in Document will close, but i think i got the syntax wrong, as I get an error.

if(

this.getField("CheckBox1").value == "Off" ||

(this.getField("RadioButton").value == "Choice1" && this.getField("CheckBox2").value == "Off")

) {

app.alert("Not all check boxes are ticked!",3,0, "Attention!");

}

 

What should I change?

Thanks!

 

 

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF forms

Views

301

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 ,
Oct 14, 2020 Oct 14, 2020

Copy link to clipboard

Copied

What error does you get?

Votes

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 Beginner ,
Oct 14, 2020 Oct 14, 2020

Copy link to clipboard

Copied

It just says "Syntax Error: syntax error 8"

Votes

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 ,
Oct 15, 2020 Oct 15, 2020

Copy link to clipboard

Copied

Try this:

Execute the script in the Javascript console.

Votes

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 Beginner ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

Thank you! It appears that I was using too many ||, and not enough ), but it works correctly now.

The other problem I got into now is that my code is 104000 characters long and it does not fit in the Java Script Editor. Is there any workaround that? 

Votes

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 ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

LATEST

You can use a external text editor

Votes

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