When checkbox is checked, disable other checkboxes

New Here ,
Nov 23, 2017

Copy link to clipboard

Copied

Hi,

I've read an earlier discussion about disabel checkboxes but the discussion was to advanced for a rookie like me,

so please, in a very beginner-friendly way, please explain with a javascript how to do the following:

(In Adobe Acrobate DC I'm doing a fillabe form.)

There are three checkboxes named: checkbox1, checkbox2 and checkbox3.

I wish the following to happen:

When checkbox1 is checked:

  • then checkbox2 and checkbox3 become disabled (by disabled I mean the checkboxes become not checkable/not clickable)

          and

  • also at the same time checkbox2 and checkbox3 become unchecked if they were earlier checked.

Thanks

/Dennis

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.7K

Likes

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

When checkbox is checked, disable other checkboxes

New Here ,
Nov 23, 2017

Copy link to clipboard

Copied

Hi,

I've read an earlier discussion about disabel checkboxes but the discussion was to advanced for a rookie like me,

so please, in a very beginner-friendly way, please explain with a javascript how to do the following:

(In Adobe Acrobate DC I'm doing a fillabe form.)

There are three checkboxes named: checkbox1, checkbox2 and checkbox3.

I wish the following to happen:

When checkbox1 is checked:

  • then checkbox2 and checkbox3 become disabled (by disabled I mean the checkboxes become not checkable/not clickable)

          and

  • also at the same time checkbox2 and checkbox3 become unchecked if they were earlier checked.

Thanks

/Dennis

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.7K

Likes

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
Nov 23, 2017 0
Adobe Community Professional ,
Nov 23, 2017

Copy link to clipboard

Copied

A custom JavaScript for the "Mouse Up" action:

// set readonly property based on the value of this field compared to "Off";

this.getField("checkbox2").readonly = (event.target.value != "Off");

this.getField("checkbox3").readonly = (event.target.value != "Off");

Likes

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
Reply
Loading...
Nov 23, 2017 0
New Here ,
Nov 24, 2017

Copy link to clipboard

Copied

Thanks a lot gkaiseril,the script is working well .

Is it possible though to get checkbox2 and checkbox3 unchecked (if they were previously checked) when they become disabled by checking checkbox1?

Likes

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
Reply
Loading...
Nov 24, 2017 0