除按钮外禁用所有表单项
除按钮外禁用所有表单项
$(function () { $("form").each(function (i, form) { for (var i = 0; i < form.length; i++) { var element = form.elements[i]; if (element.nodeName != "BUTTON") element.disabled = "true"; } }) })
启用所有表单项:
$(".edit").click(function () { $("form").each(function (i, form) { for (var i = 0; i < form.length; i++) { var element = form.elements[i]; $(element).removeAttr("disabled"); } }) form.render(); })