I have an input field which is number type in my form. It is not a mandatory field. So i have not given required attribute. But whenever the user gives value to it he must provide only numeric value and not alphabets or any special characters. How to validate this in ng-show of angularjs?
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
Hope this Thread will solve your problem. Solving a Regex for a number range You can get your regex pattern for any number range in http://utilitymill.com/utility/Regex_For_Range according to this thread. |
|||
|
Please see here for example : http://jsbin.com/renegica/12/
|
|||||||||||||||||
|
Use angular-ui mask here-> http://angular-ui.github.io/ui-utils/#/mask Here is an example of my using it with a phone number pattern:
|
|||
|