input mask form validation

Issue with this is that the record must be sent to Salesforce for validation rule to work. I want client side. Instant and thus a better UX.