Angular form validation not working inside a modal dialog

Abhishek Bansal picture Abhishek Bansal · Jul 9, 2015 · Viewed 8.9k times · Source

I have a registration form inside a modal window from ui-bootstrap library. I am trying to get validations working on this form without any success. I am not sure what am I doing wrong.

here is link to plunker demonstrating same issue http://plnkr.co/edit/9QUsvBWd0XAAryqtGUI1?p=preview

Answer

Keammoort picture Keammoort · Jul 9, 2015

You misspelled regForm - it was regFrom, see it's working now: http://plnkr.co/edit/17Yaokycc3Xa0IeWr24M?p=preview

Correct span with error message:

<span style="color:red" ng-show="regForm.email.$dirty && regForm.email.$invalid">
    <span ng-show="regForm.email.$error.required">Email is required.</span>
    <span ng-show="regForm.email.$error.email">Invalid email address.</span>
</span>