{literal} {/literal} {footer_script}{literal} $(document).ready(function() { $("select[name=who]").change(function () { $("[name^=who_]").hide(); $("[name=who_"+$(this).attr("value")+"]").show(); }); function checkWhereOptions() { var recursive = $("input[name=recursive]"); var create = $("input[name=create_subcategories]"); if ($("select[name=category] option:selected").val() == 0) { $(recursive).attr("disabled", true); $(recursive).attr('checked', true); } else { $(recursive).removeAttr("disabled"); } if (!$(recursive).is(':checked')) { $(create).attr('checked', false); $(create).attr("disabled", true); } else { $(create).removeAttr("disabled"); } } checkWhereOptions(); $("select[name=category]").change(function() { checkWhereOptions(); }); $("input[name=recursive]").change(function() { checkWhereOptions(); }); $("#displayForm").click(function() { $("[name=add_permission]").show(); $(this).hide(); return false; }); }); {/literal}{/footer_script}