Issue
I am working on registration form for my project in AngularJs. Users can register with his/her Email/Phone. I need to validate that particular text-box.
I have validations for both, with different text fields, with ng-pattern. But how can I validate for both in one text field?
I have updated my code, here:- enter code here
http://plnkr.co/edit/mCVxHxl2DIvqOYtVapRN?p=preview
Solution
Use /^([_a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,5}))|(\d+$)$/
Answered By - Shamal Perera
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.