• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Adobe form check box, X or O in same box ?

New Here ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

I am making a monthly checklist  form that has lots of items to check. I would like to be able to single click and get a checkmark (for a pass), and double click or right click to get an X (for a fail) in the same box. I'm sure it should be simple, but  not for me anyway. Suggestions? Thanks in advance.

TOPICS
PDF forms

Views

2.1K

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 ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

Ha ha, that's funny.  You think a complex, non-standard behavior should be easy because you don't know anything about it.

I'm assuming that you want the unchecked appearance as the starting position, so what you are describing is a 3-state button. This is possible, but it's not straight forward. The Acrobat JavaScript does not provide a 3 state button, so it has to be created from the ground up with custom scripting. I did a search and couldn't find any similar questions.  So it really needs to be done from scratch.

I'm not going to script it for you for free, but I can give you some direction on how this can be done. First, since it needs a custom appearance and behavior it is best to start with a Button rather than a Checkbox, because the button is easier to customize. It can be easily made to look like a checkbox. But the main trick is maintaining state. You'll need a persistent storage area for this. I think the best choice is to use the Caption field of the button itself, but any of the button field properties that can be modified in reader are good. Then the code on the MouseUp event for the button needs to implement a simple 3 state, state machine (a switch statement is perfect). There are no "double click" events in Acrobat JS so the simplest solution is to just move to the next state on each click.

Keep in mind that a custom solution like this one will only work on the desktop Acrobat and Reader.

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 ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

Since my knowledge of Adobe and PDF forms is limited, and not knowing this is such a complex and non standard behavior for the program, that's why I reached out to the forum. I do wish I was as funny when I try to be, not when I am trying to be serious.

Guess I need to learn JavaScript, since my limit to programming knowledge is limited to BASIC. It will take a whole lot more time than I have to invest in it right now. I will  just tell the Boss the choices are either checked or blank. I did find one other reference to a similar question from back in 2015, but the example file is gone, so I think I will take the simple route for this form, and go with checked or not.

Thanks for the suggestion though, I will see what I can cobble together when I have time to play around with it more.

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 ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

fallingken  wrote

I'm sure it should be simple...

The funny part is your assurance to us that it should be simple, even though you have no knowledge of the topic.

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
Community Expert ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

Instead of right-click or double-click you can simply use a regular click, and a script to toggle between all the states. That's much easier to implement (I'm not sure what you asked for is at all possible). See this thread, and especially my reply which was marked as correct: Javascipt for Tri State Button Please Help

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 ,
Apr 20, 2018 Apr 20, 2018

Copy link to clipboard

Copied

LATEST

That's my suggestion   Thanks for implementing it, except, I would have used a switch statement.

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