I'm trying to add a validation rule to the registration name field. I've added in my validation.js file a function like:
this.setHandler('name',
function (value) {
regex=/^\S[\S ]{2,98}\S$/;
return regex.test(value);
}
);
In registration.xml (components/com_users/models/forms/), I have added to the name field:
class="validate-name"
validate="name"
But it's still not validating against the rule. What am I doing wrong?