Hi Experts,
I am using HTML5,BOOTSTRAP and AngularJS and need to validate two numeric fields using AngularJS
1)NumericField1: Allow maximum 9 numeric values ie.without special characters,white spaces,alphabets etc.
valid entries: 111111111(count=9),11111(count=5)
Invalid entries: 1111111111(count=10),avbsdfas,122aafdaf etc.
2)NumericField2: Allow 9 numeric values only [9].ie without special characters,white spaces,alphabets etc and once user enters valid number (ex:111111111(count=9)) and moves to next field I need to split 9 digits into 3 chunks ie.(111 111 111) into the textbox.
valid entries: 111111111(count=9), 211511121(count=9)
Invalid entries: 11(count=2),1111111111(count=10), avbsdfas,122aafdaf etc.
Note:Both the above numeric fields are not maniditory to submit the form but if user enters a value in these fields need to validate.
I need to highlight the text boxes and show the "input not in correct format" message besides the textbox.
Please provide me with sample working code.
Thanks in Advance
see this example. it has everything you need to accomplish what you are looking for:
http://docs.angularjs.org/api/ng.directive:input