I want to validate an email. I know how to do it in python code, but I want to do this using XML, below is my XML field:
name="email" widget="regex_mask" data-inputmask-regex='[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}' context="{'gravatar_image': True}"
This is not working on email, I have also used:
widget="regex_mask" data-inputmask-regex="^\d+$"
On char filed, and it is working fine.
It would not take any character from the keyboard. If anyone knows how to do this... please let me know, I'm waiting for your answer :) Thanks.
JQuery-Inputmask has a built-in
emailmask extension.So instead of your
data-inputmask-regexattribute, you should be able to just replace it with