RE: Need Javascript Review
Hi Chrisbra22,
Here you are
function FieldValidation(executionContext) {
let isValidate = false;
try {
var formContext = executionContext.getFormContext();
var field = formContext.getAttribute("bf_dot1").getValue();
if (field.length < 8) {
formContext.ui.setFormNotification("Please enter 8 or more characters in field DOT #1", ERROR , "bf_dot1");
isValidate = true;
}
var field = formContext.getAttribute("bf_dot2").getValue();
if (field.length < 8) {
formContext.ui.setFormNotification("Please enter 8 or more characters in field DOT #2", ERROR, "DOT #2");
isValidate = true;
}
var field = formContext.getAttribute("bf_dot3").getValue();
if (field.length < 8) {
formContext.ui.setFormNotification("Please enter 8 or more characters in field DOT #3", ERROR, "DOT #3");//Do the same for remainings
isValidate = true;
}
var field = formContext.getAttribute("bf_dot4").getValue();
if (field.length < 8) {
alert("Please enter 8 or more characters in field DOT #4");
isValidate = true;
}
var field = formContext.getAttribute("bf_dot5").getValue();
if (field.length < 8) {
alert("Please enter 8 or more characters in field DOT #5");
isValidate = true;
}
var field = formContext.getAttribute("bf_dot6").getValue();
if (field.length < 8) {
alert("Please enter 8 or more characters in field DOT #6");
}
if (isValidate) {
executionContext.getEventArgs().preventDefault();
}
} catch (e) {
}
}
If I answer your question then please mark it as verified.
Let me know if I can provide you with more details.
Thanks
Regards,
Abdul Wahab
Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
Direct/WhatsApp:+923323281237
E-mail: abdulwahabubit@outlook.com
Skype: abdul.wahabubit
Linkedin: www.linkedin.com/.../