javascript - AngularJS ng-pattern regular expression -
i have following input field accepts price value.
input{ type="text" name="price" np-currency=true ng-model='price' ng-pattern="/[$,.]\d*$/" } this pattern("/[$,.]\d*$/") makes input field invalid $25.34@@@c%34 correct 25 becomes invalid thats because not have either $ or , or. how make optional?
i need $25.00 or 25 valid not $25.00$%#$%%@@.
requirement: digits $, , . valid
i appreciate suggestions on regular expression.
Comments
Post a Comment