I am trying to validate phone number for the below condition, If all 10 digits are of same number,it should display an error message. If it starts with 1, it should display an error message. Please share your suggestion if you have come across such scenario.
Asked
Active
Viewed 184 times
-1
-
Please share some code – Shashank Agrawal Sep 07 '16 at 13:38
-
(hint: use pattern regex )Do you even try something to do so ? – Dan M. CISSOKHO Sep 07 '16 at 13:43
-
"All 10 digits same number → error" – did you randomly come up with this rule, or is there anything inherent in the telephony system that prevents anyone from getting a number like that? – deceze Sep 07 '16 at 13:44
1 Answers
0
Without example code, it will be hard for us to see what you are trying to do - and if you have even attempted at solving it yourself.
But oh well, there are multiple ways of doing this, what you want is serverside validation - as you NEVER want to validate on the users end.
How can you limit the value from input using AngularJS?
Adding a listener on a model in angularjs With this one (And I 'THINK' this is what you want), you can update 'something' according to what is being input into the text area.