Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4130 Lượt xem

hello odoo family 
i want to validate an valid email i know how to do it from 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}"

 but this thing is not working on email
i have also use widget="regex_mask"  data-inputmask-regex="^\d+$" on char filed and this is working fine

it would not take any character from keyboard 
i any one know how to do this ... please let me know i'm waiting for your answer :)



Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

JQuery-Inputmask has \a built-in email mask extension.

So instead of your data-inputmask-regex attribute, you should be able to just replace it with

data-inputmask-alias="email"
and it will work fine and for more useful u can add placeholder for showing example
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 24
2619
3
thg 4 24
5699
0
thg 7 22
1048
0
thg 8 21
3125