'Enable text field if mentioned conditions met - jsp and java script

enter image description here

In the following image, I want to enable and disable the text-field named "Individual" and "Family" under Annual HSA ER Contribution Limits.

Enable: Enable textbox if only "HEALTH_MEDICAL" is selected in the subtypes and only "Excess credits can be Applied to HSA" is checked.

Disable: Disable textbox if above conditions is not met and make the fields null before disabling them.

The code is written in jsp and I have solved this problem with java but now I want to do it in javascript.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source