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.
Copy link to clipboard
Copied
At what event does you use the script?
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
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.
Copy link to clipboard
Copied
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.