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

Limit response , acrobat

New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

Hello, I am looking for the possibility of limiting the choice of checking 20 buttons out of 25 offered?
thank you

 

TOPICS
PDF forms

Views

471

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

Copy link to clipboard

Copied

Hi,

Would just keeping a track of the number clicked and then make them the unchecked ones either read-only or hidden work?

 

You could just have 25 checkboxes and on each check box call a document level javascript to count and change the read only flag/hide the field.

 

Let us know if that would be a suitable solution.

 

Regards

 

Malcolm

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
New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

In fact here is my complete problem, for elections there are 25 candidates and people must tick a maximum of 20 times?
script thanks

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
New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

can I send you the pdf if you want?

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

Copy link to clipboard

Copied

Hi,

 

please do attach the pdf to the first message then we will be able to provide a better answer.

 

Regards

 

Malcolm

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
New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

Capture d’écran 2020-11-19 à 16.16.05.png

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

Copy link to clipboard

Copied

Do you mean a maximum of 20 checks of "OUI"?

 

To do this create a separate text field and place the following code in the calculation script for that text field

The text field should be hidden from the user. It's only purpose is to run the script.

 

To make this work you are going to need to make some changes on the form. And this is true for any kind of form work. 

All of the radio button names and export values must be consistent. I cannot overstate how important this is.

The radio button names are ok, but all the choice values need to be changed so that the "OUI" choice is "Choix1", "NON" is "Choix2", and "ABSTENTION" is "Choix3".

 

 

 

// Only run code for a "Group" radio button selection, and only if "OUI" is selected
if(/Group/.test(event.source.name) && (event.source.value == "Choix1"))
{  // Count Number of current Selections
   var nCnt = 0;
   for(var i=1;i<=25;i++)
   {
      if(this.getField("Group"+i).value == "Choix1")
         nCnt++;
   }
   // Block current selection if over maximum
   if(nCnt > 20)
     event.source.value = "Choix3";
}

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

Good evening, I do not arrive, can I send you by mail or other my pdf to help me please, to enter the script, thank you?

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

Copy link to clipboard

Copied

To make this work you only need to do two things.

1) Set the choice values on the radio buttons correctly

2) Create a new text field and enter the script into the calculation on that text field.

 

If you need custom training/consulting on this issue, then I or another expert on this forum can help you for a fee.  

 

 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
Nov 19, 2020 Nov 19, 2020

Copy link to clipboard

Copied

Hello, sorry but I can't do it, Please tell me the price for this service because I really need it for tomorrow afternoon, paypal?  

 

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 ,
Nov 20, 2020 Nov 20, 2020

Copy link to clipboard

Copied

LATEST

You can message me through this forum or contact support at www.pdfscripting.com

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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