AUI validation for phone number, special characters(only +, - and space )
In below example, just shown how to validate phone number using required special characters <aui:input type="text" name="phoneNumber" label="PhoneNumber" > <aui:validator name="custom" errorMessage="You can enter a maximum of 30 numeric and special ( only +, - and space ) characters"> <aui:validator name="maxLength">30</aui:validator> function (val, fieldNode, ruleValue) { var returnValue = true; var iChars = "~`!@#$%^&*()_=[]\\\';,./{}|\":<>?qwertyuiopasdfghjklzxcvbnm"; for (var i = 0; i < val.length; i++) { if (iChars.indexOf(val.charAt(i)) != -1) { returnValue = false; ...