Hi
The workaround for this is to write own custom validator, it is very easy.
Please have a look at this :-
Registering custom validators is done by calling the jQuery based $.validator.register method. The register method takes a single JavaScript object literal argument. The parameter looks for four properties: selector, validate, show and clear, of which only selector is required.
$.validator.register({
selector: '.field-phonenumber',
validate: function(el) {
var field,
value;
field = el.closest(".coral-Form-field");
value = el.val();
if (!/^\d{3}-\d{3}-\d{4}$/.test(value)) {
return Granite.I18n.get('The field must be a phone number in the format of "xxx-xxx-xxxx"');
}
},
show: function (el, message) {
<code>
},
clear: function (el) {
var field = el.closest(".coral-Form-field");
<code>
}
});
Please have a look at this community article written by Nate Yolles :- http://www.nateyolles.com/blog/2016/02/aem-touch-ui-custom-validation
I hope this will help you.
Thanks and Regards
Kautuk Sahni
Kautuk Sahni