Hello,
Can any one please check for me if there is something wrong or if I miss any thing in the statement below which causes it to not working right. User fills the form and submit it to the manager, when the manager approve/deny then he/she should fills the other fields. If they miss one then a pop up message will tell them that they need to fill that field which is highlighed.
if
(AWS_ACTION.rawValue == "Deny" && (form1.Wellness_Page1.denied_reason.rawValue == null || form1.Wellness_Page1.denied_reason.rawValue == "" ) )
{
app.alert("Please select deny, enter your name and today's date for denial. ");
form1.Wellness_Page1.denied_reason.mandatory
= "error"; // make the comments field mandatory
form1.Wellness_Page1.SupDeny.mandatory
= "error"; // make the fields mandatory
form1.Wellness_Page1.sup_signature.mandatory
= "error";
form1.Wellness_Page1.SupDate.mandatory
= "error";
xfa.event.cancelAction
= true; // This line will prevent submitting the form
}
else {
(AWS_ACTION.rawValue == "Approve" )
{
app.alert("Please select approve, enter your name and today's date for approval. ");
form1.Wellness_Page1.SupApprove.mandatory
= "error"; // make the fields mandatory
form1.Wellness_Page1.sup_signature.mandatory
= "error";
form1.Wellness_Page1.SupDate.mandatory
= "error";
xfa.event.cancelAction
= true; // This line will prevent submitting the form
}
}
Please advise.
Thanks, Han