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
Use /^([_a-z0-9]+(\.[_a-z0-9]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,5}))|(\d+$)$/
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With