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

Can you change the symbol in a checkbox on click?

New Here ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

I would like to create a form that has checkboxes that when clicked once are an X and when clicked twice are a checkmark. Is this possible or do I need multiple checkboxes, one for x's and one for checkmarks? 

TOPICS
Create PDFs , How to , PDF forms

Views

2.8K

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 ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

You can loop through checkbox style on click but not sure how you imagined clicking twice?

You can read here how checkbox style is changed and you can adapt code to use on click in checkbox:

https://community.adobe.com/t5/acrobat/changing-check-box-style-for-entire-document/m-p/12082784 

 

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 ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

Hi Nesa,

 

Thanks for your response. What I'm hoping is that the client is able to click the box and as you said, loop through two different checkmark options. For example, click once, it's a checkmark. Click again, it's an X. Click again, it's blank. Click again, it's a checkmark, etc. etc. 

 

Does that make sense? Is your proposed solution still accurate for this situation? 

 

Thanks for your 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 ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

EDIT: I just saw post by bebarth, I belive he answered your question.

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 ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

Here is an example with a 3-option check box.

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 ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

While the checkbox does loop through the different styles, the value of the checkbox is the same for both cross and check, so it's not a true 3-state check. This technique is also potentially problematic in Reader, since changing the style officially requires form rights. You'll need to use a variation or a different technique if you will need the 3-State value.

Also keep in mind that this type of scripting will only work in a few of the better PDF viewers.     

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 ,
Aug 04, 2021 Aug 04, 2021

Copy link to clipboard

Copied

LATEST

You are right, this example was a 3-option and not a 3-state check box. It was an example I did a few years ago for somebody who didn't need export values. But that doesn't mean it is not possible. Attached is an other example with multi-state check boxes. There are several ways to do that in accordance with what we need at the end.

You are right about the JavaScript and pdf viewers too, but if we only have to write for what is understood by all viewers, we won't write very much anymore.

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