chokka
asked on
How to enable or disable radio button based on check box selection in Jquery ?
How to enable or disable radio button based on check box selection in Jquery ?
Check box click function is written inside the ready. function.
Check box click function is written inside the ready. function.
$("#Other").on("click", function ()
{
if ($("#Other").is(":checked"))
{
document.getElementById('Yes').disabled = false;
document.getElementById('No').disabled = false;
}
else
{
document.getElementById('Yes').disabled = true;
document.getElementById('No').disabled = true;
}
});
$("#Other").trigger("click");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Julian, I will accept as solution. However, the solution which I have has. Trigger event to fire the click function
I can add the trigger event - by why do you need it? Why not just set the state of the checkbox and radio's to what you want when the page loads?
ASKER
Thanks
ASKER