hooking up custom validation
Hi all.
AEM (6.2) Forms provides validation facilities for entry fields (email, telephone) for example. We'd like to add new functions that we can share, for more than just simple patterns. In the rules editor (visual editor) there is function list you can use. We'd like to add to that.
We tried creating this:
/**
*Validate pattern
*@param {string} pattern - the pattern to use
*/
function ValidatePattern(pattern) {
console.log('hello');
return (this.value && this.value.match(pattern) == null) ? false : true;
}
..Just to see if "ValidatePattern" would show up in the VisualEditor/FunctionsList. It *does*, but it's not called.
Suggestions?
-Joel