diff --git a/admin/award_awards.php b/admin/award_awards.php index ddf317a..ca42a88 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -272,6 +272,13 @@ function update_awardinfo() return; } + /* Enable all fields */ + $("#awardinfo_name").removeAttr('disabled'); + $("#awardinfo_sponsors_id").removeAttr('disabled'); + $("#awardinfo_description").removeAttr('disabled'); + $("#awardinfo_criteria").removeAttr('disabled'); + $("#awardinfo_award_types_id").removeAttr('disabled'); + $.getJSON("?action=awardinfo_load&id="+award_id, function(json){ $("#awardinfo_id").val(json.id); @@ -287,6 +294,15 @@ function update_awardinfo() $("#awardinfo_selfnominate").val([json.self_nominate]); $("#awardinfo_schedulejudges").val([json.schedule_judges]); + /* Disable fields we dont' want the user to edit */ + if(json.award_source_fairs_id != null) { + $("#awardinfo_name").attr('disabled', 'disabled'); + $("#awardinfo_sponsors_id").attr('disabled', 'disabled'); + $("#awardinfo_description").attr('disabled', 'disabled'); + $("#awardinfo_criteria").attr('disabled', 'disabled'); + $("#awardinfo_award_types_id").attr('disabled', 'disabled'); + } + }); }