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

Help with PDF JavaScript

New Here ,
Jul 09, 2020 Jul 09, 2020

Copy link to clipboard

Copied

Hi community, 

      I would like some help with some javascript ! The script I found helps me with marking circles over answers on a pdf that I have. However, I would like some help changing the code so that if I click on the button again, the circle disappears--to give people the option of selecting and deselecting. Any help much appreciated. 

The code is below. Credit Source: http://khkonsulting.com/2016/11/mark-selected-options-with-circles-in-pdf-forms/#:~:text=On%20the%20...

var baseName; var currentState;

 

// get our name

var theName = event.target.name;

 

var re = /(.*)\.(.*)/; var ar = re.exec(theName);

 

if (ar.length > 0) {

    baseName = ar[1];

    currentState = ar[2];

 

    // make this button visible

     event.target.buttonSetIcon(this.getField("icon").buttonGetIcon());

     event.target.buttonPosition = position.iconOnly;

 

     // hide the other button var f_parent = this.getField(baseName);

     var f = f_parent.getArray();

     for (var i in f) {

          if (f[i].name != theName) {

               f[i].buttonPosition = position.textOnly;

           }

         }

       }

       this.calculateNow();

TOPICS
Acrobat SDK and JavaScript

Views

267

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

Copy link to clipboard

Copied

LATEST

I would say that, in lieu of no one responding to your inquiry yet, that the adequate netiquette (or to show some respect to  to the original author of this script)  is to contact Karl Heinz Kremer  at  KHKonsulting LLC: khkonsulting@khk.net

 

 

 

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