Hello,
I think it is possible. You can create your own custom JS code and listen to the submit button, when the action click is fired, run your own code to validate the field.
Otherwise, you can look for a PHP library or snippets and use the callback function to validate/sanitize the field value.