Hi Martin,
You had raised couple of questions.Here are my responses to them one by one:
1) As of now we don’t have JS validation hooks.Unlike PHP , JS is async in nature which ups the level of the problem.We will think through this more thoroughly and incorporate it later on.
2) Having said that , here is a way to achieve the solution. After your script has AJAX response, use below snippet to let our script trigger the validation message you want to show:
https://gist.github.com/djeet/efbd4e6a6e875f12b192035d1a8f6797
3) To answer ” maybe give us the ability to disable your real time validation on a particular field” , let me explain explain hierarchy of features:
A. At top is toggle switch which lets you enable real time validation on form level for all fields.
B.At next level we have validation for “Required”. This kicks in real time once real time validation is “Enabled”
C. At third layer we have Regex based validation which can be selected to enable even more advanced regex based validations.
Now it would be confusing for user ( and end user) to disable a particular field from realtime.
Imagine we have two fields in a form:
Field 1 (which has realtime enabled and required)
Field 2( which has realtime disabled and required)
Submit
Suppose user goes into Field 1 and focuses out. In this case error for required will trigger on Field 1 ( as realtime is enabled) .Right?
Now user presses Submit. ( Note: Field 2 is still empty)
He would see “This field is required” message on Field 2. This would really surprise him and make him think “Why did the form not show me this message for Field 2 while i did get rejection notice for Field 1?”
Trick is not to surprise user ??
4) However I do agree that “Validate Real Time Input” should be been better worded to may be say ” Advanced Input Validation (via Regex)”
Hope this will solve your queries.
Thanks
Jeet