SP behaviour is little bit strange. If you change value of some field, SP invoke validation, but no message is displayed. Problem is that SP has in file clientforms.js:
this.NotifyControlEvent = function(eventName, fldName, eventArg) { ...
case SPClientForms.FormManagerEvents.Event_OnControlValueChanged:
UpdateAndValidateControlValue(fldName, eventArg, false);
...
}
function UpdateAndValidateControlValue(fName, fVal, bDisplayError) {
...
ValidateControlValue(fName, fVal, bDisplayError);
}
So when value is changing function UpdateAndValidateControlValue(fldName, eventArg, false); is called, but no validation message is displayed.
But when the form is submiting, this function is called with true parameter and valiadation messages is displayed.
I wasn't able to inject this script to change this weird behaviour.
But if you have access to clientforms.js in file system, you can easily change it. To change all SP behaviour you can simply change false to true in function NotifyControlEvent.
But I would recomend you to use some input parameter, so you can specify which field will have onchanged validation.
this.NotifyControlEvent = function(eventName, fldName, eventArg) {
...
case SPClientForms.FormManagerEvents.Event_OnControlValueChanged:
//this.customFieldSettings is custom property of SPClientForms.ClientForm, which you have to fill
if (this.customFieldSettings !== undefined &&
this.customFieldSettings[fldName] != undefined &&
this.customFieldSettings[fldName].onchangeValidation == true)
{
UpdateAndValidateControlValue(fldName, eventArg, true);
} else {
UpdateAndValidateControlValue(fldName, eventArg, false);
}
return;
I Hope it will help and lead to simpler solution.