validation failures are shown in-line, within the DynamicForm. Is there a function or technique to override this and instead present a dialog (via isc.say() for example) to show the validation error message?
Hi Pete,
There are a few ways this could be done. One option is to override ‘setErrors()’ to simply display the errors directly to the user rather than storing them on the form to be displayed inline:
isc.DynamicForm.create({
ID: "boundForm",
dataSource: "valueTransform",
setErrors : function (errors) {
var hasErrors = false,
errorString = "Validation Errors Occurred";
for (var field in errors) {
hasErrors = true;
errorString += "<br> - " + field + ":" + errors[field];
}
if (hasErrors) isc.warn(errorString);
}
});
isc.Button.create({
top: 60,
title: "Validate",
click: "boundForm.validate()"
});