Using jQuery to toggle form elements on or off. The following jQuery code toggles the input areas on or off by adding the disabled attribute to their DOM nodes. Here is the JS BIN version http://jsbin.com/ozogo3/2
$(function() {
$("#disableAll").click(function() {
var button = $(this).val();
if (button == 'Disable All') {
$('input:not(.disb), textarea, table, select')
.attr('disabled', 'disabled');
$("#disableAll").val('Enable All');
} else if (button == 'Enable All') {
$('input:not(.disb), textarea, table, select')
.attr('disabled', '');
$("#disableAll").val('Disable All');
}
});
});