Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS Form Validation Not Working in Chrome

I'm having trouble getting angularjs form validation to work in Chrome. I have a super simple example plunker that illustrates the issue. If you enter non-numeric data into the box and click the button, it still says the form is valid in Chrome. But if you do that in Firefox, it shows it as invalid which is what I would expect. What's going on here?

Thanks,

Andy

like image 308
Andy Avatar asked Jan 26 '26 21:01

Andy


1 Answers

Looks like a bug with AngularJS and Chrome, try to add required to the input and it should work:

<input type="number" step="any" name="someNumber" ng-model="someNumber" required />

Here's a plunker to test it.

This is the open issue on AngularJS.

like image 87
Atropo Avatar answered Jan 29 '26 11:01

Atropo