These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need help Using combo box items to activate check boxes

jwillis44
Registered: Dec 1 2011
Posts: 4
Answered

What I'm trying to do is when you pick one of the numbers Range 1 to 15, in the combo box, it will activate that many check boxes. I'm new to all this and need some help
 
The combo box is named Stat1 and I have each number in the combo box having a different value.
 
Any help is most appreciated.
 
I don't have any script written yet.

thanks,
John willis

My Product Information:
Acrobat Pro Extended 9.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
What do you mean by "activate"? Tick? Make editable? Make visible? Create?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

jwillis44
Registered: Dec 1 2011
Posts: 4
To show them checked when the number is chosen. If you pick the number five in the combo box I would like that number of check boxes Checked. so if you pick 12 then 12 boxes are checked. Hope that make sense.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
What are the names of these check-boxes?

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

jwillis44
Registered: Dec 1 2011
Posts: 4
OK the combo box is ( Stat1 ) within the combo box is ( "0 thru 15" with the value if needed set same as the 1 - 15 )

There are 16 check boxes named ( "Stat Icon1" thru "Stat Icon16" )
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
You can use something like this as the Validate code of your combo box:

  1. var n = Number(event.value);
  2. for (var i=1; i<=16; i++) {
  3. this.getField("Stat Icon"+i).checkThisBox(0, (i<=n));
  4. }

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

jwillis44
Registered: Dec 1 2011
Posts: 4
Thank you very much. That script worked perfectly. you were a great help - I had been trying to get it to work for 2 days before I found this site. I just joined today and I got an answer that worked right off, on the first try thanks to you.

Again Thank You very much, try67.