Skip to content

Commit

Permalink
Update ofm_Intake.Form.js (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyiwang-cgi authored Sep 16, 2024
1 parent 572279c commit f76f2d6
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,17 @@ OFM.Intake.Form = {
});

return visable;
},
validateCohortNumber: function(executionContext){
debugger;
var formContext = executionContext.getFormContext();
var cohort = formContext.getAttribute("ofm_cohort").getValue();

//validation required must be numeric and 6 digits
if(!/^\d+$/.test(cohort) || cohort.length != 6){
formContext.getControl("ofm_cohort").setNotification("Cohort should be 6 digits in 'MMYYYY' format.", "validation_rule");
}else{
formContext.getControl("ofm_cohort").clearNotification("validation_rule");
}
}
};
};

0 comments on commit f76f2d6

Please sign in to comment.