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

Checkboxes with javascript won't appear selected in acrobat DC

New Here ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

I added values to several checkboxes using javascript in Acrobat DC so their total sum could add up and be printed on a read only textbox.

but everytime i select a checkbox, the check won't appear on the checkbox and i cannot unselect it (since the check doesn't appear in the first place). Though I know that it is selected because the value would appear on the read only textbox, but there is no way to unselect it.

 

this is the code that I used on the checkboxes

if (event.target.isBoxChecked(0)) this.getField("concierge1").value = 60; else this.getField("concierge1").value = 0;

 

for the read only text field, i just selected the calculate preset of acrobat.

 

is there any way i could fix this with a code?

thanks.

TOPICS
JavaScript , PDF forms

Views

237

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 ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

At what event does you use the script?

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 ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

for ticking the checkboxes. 

everytime i select an item, the corresponding value adds up, which will be printed on the read only textbox

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 ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

Did you perhaps used radio button instead of checkbox?

Simple solution for this would be to give checkboxes export value to be value you want (e.g. 60...etc) then in readonly field, in calculate tab select 'value is the' and pick checkboxes.

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 ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

LATEST

Are you sure you used a check-box and not a radio-button? The former can be "unselected", the latter can not. You can only switch to a different value in the radio-button group, once a value has been selected, unless you clear the form.

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