Yes, using JS click event we can add the required functionality and validation.
Thank you, I have very limited knowledge of JS. Do you have an example code of JS click event?
<!-- JavaScript -->
<script>
function enableUtilized() {
// Enable the utilized checkboxes when "Offered" is selected
const utilizedCheckboxes = document.querySelectorAll('inputpname="utilized"]');
utilizedCheckboxes.forEach(checkbox => checkbox.disabled = false);
}
function disableUtilized() {
// Disable the utilized checkboxes when "My organization does not offer me support" is selected
const utilizedCheckboxes = document.querySelectorAll('input'name="utilized"]');
utilizedCheckboxes.forEach(checkbox => {
checkbox.disabled = true;
checkbox.checked = false; // Also uncheck the checkboxes
});
}
</script>
In this example, the JavaScript functions enableUtilized()
and disableUtilized()
handle the logic for enabling and disabling the checkboxes in Column 2 based on the selection in Column 1. The onchange
attribute is used in the radio buttons to trigger these functions when the user makes a selection.
#using c1 as first column class, c2 is column name for 2nd class
Your code should look something like below, play with it!
jQuery(‘.c1’).each(function() {
if(jQuery(‘.c1’).is(‘checked’)==True)
{
jQuery(‘.c2’).css(‘visibilitiy’,’none’)
}
else
{
jQuery(‘.c2’).css(‘visibilitiy’,’visible’)
}
})