I have the following jquery code which works fine.
$('#onlyTwo').click(function() {
$("#textarea3").attr("disabled", true);
$("#textarea4").attr("disabled", true);
$("#radio3").attr("disabled", true);
$("#radio4").attr("disabled", true);
return true;
});
This is making some fields disabled when 'onlyTwo' checkbox is clicked. How can i make these fields enabed again when 'onlyTwo' checkbox is unchecked...
basically i want to know how to find out whether a checkbox is checked or not
or
$('#onlyTwo').click(function(){
var stuff = $("#textarea3, #textarea4, #radio3, #radio4");
stuff.attr("disabled", $(this).is(":checked"));
});
$('#onlyTwo').change(function() {
$('.disableMe').attr('disabled', $(this).is(':checked'));
});
so you need to add 'disableMe' class to all the inputs, textareas, selects... that you wish to disable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With