diff --git a/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml b/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml index 4165c20..391bf59 100644 --- a/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml +++ b/Fab2ApprovalSystem/Views/CorrectiveAction/Edit.cshtml @@ -3126,7 +3126,7 @@ $('#D5Completed').prop('checked', false); return; } - TriggerSectionApproval('D5D6D7') + TriggerSectionApproval('D5D6D7'); } else { $('#D5Completed').prop('checked', false); @@ -3453,6 +3453,47 @@ } + $("#CASubmitted").on('click', function () { + var submittedValue = $("#CASubmitted").val(); + if (submittedValue) { + //If checkbox is now selected as true + caAssignee = $("#D1AssigneeList").val(); + caQa = $("#D1QAList").val(); + title = $("#txtCATitle").val(); + caSource = $("#CASourceList").val(); + caDueDate = $("#txtD8DueDate").val(); + caRequestor = $("#RequestorList").val(); + var errorMessage = ''; + if (caAssignee == '') { + errorMessage += 'CA Assignee is missing! \n' + } + if (caQa == '') { + errorMessage += 'CA QA is missing! \n' + } + if (title == '') { + errorMessage += 'CA Title is missing! \n' + } + if (caSource == '') { + errorMessage += 'CA Source is missing! \n' + } + if (caDueDate == '') { + errorMessage += 'CA D8 Due Date is missing! \n' + } + if (caRequestor == '') { + errorMessage += 'CA Requestor is missing! \n' + } + + if (errorMessage != '') { + //Uncheck CA Ready Checkbox + //Display reason what's missing' + $("#CASubmitted").prop('checked', false); + alert('Error! Not able to select CA Ready!\n The following fields must be completed:\n ' + errorMessage); + + } + } + + + }); $("#SaveCorrectiveAction").on('click', function (e) { $('#cover-spin').show(0); e.preventDefault();