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

Dependent check boxes, how to check all previous boxes, but not the latter ones.

New Here ,
Jan 12, 2017 Jan 12, 2017

Copy link to clipboard

Copied

Hello,

I have an order form with quantities 1-60, each with a corresponding check box.  The reason is that sometimes when a client orders our product they want ten, sometimes they want 60 sometimes more.

I would like to know how to make it so that if our client wants 47, instead of checking each of the 47 boxes i pick just the 47th box and all previous boxes are checked as well.

I don't see a way to attach my file in here, but I do not mind sending it so people can see what I am trying to accomplish.

Thank you in advance for any help.

P.S. my java and coding knowledge is nil. I am an architectural draftsperson who was, for some strange reason, tasked with making all these pdf order forms. So I am really new to this pdf form making process.

I only have access to Adobe X standard (or Pro if I kick my coworker out of her computer, for some reason she has it but not me.)

TOPICS
PDF forms

Views

3.7K

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

correct answers 1 Correct answer

Community Expert , Jan 12, 2017 Jan 12, 2017

OK, let's say the fields are called "Checkbox1" to "Checkbox60". You can use a doc-level function (although you'll need Acrobat Pro to add it) with this code and then call it from the MouseUp event of each of those fields:

function tickPreviousBoxes() {

    if (event.target.value!="Off") {

        var boxNumber = Number(event.target.name.replace("Checkbox", ""));

        for (var i=1; i<boxNumber; i++) {

            this.getField("Checkbox"+i).checkThisBox(0, true);

        }

    }

}

Votes

Translate

Translate
Community Expert ,
Jul 25, 2022 Jul 25, 2022

Copy link to clipboard

Copied

This is the danger of working with an endless loop... My bad. I fixed it now in the post above.

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 ,
Jul 25, 2022 Jul 25, 2022

Copy link to clipboard

Copied

LATEST

Thank you very much for all the help — you're just a lifesaver!

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