javascript - Input Validation in AngularJs Form -
problem,
Either way I can not validate the verification with the ERRS < p> I have made a plunker. I should only make the user input box red if the required field is not present or submit. I have made a very simple planer, just to understand.
& lt; Input type = "text" name = "email" ng-model = "userEmail" required & gt; Please
Go to this tutorial. This will give you an introduction to verification.
And if you want the verification message to appear, click on the submit button to use a flag when you click on the flag, then set the flag to the right and below the angularJs Use conditions located in
& lt; Div class = "form-group" ng-class = "{'has-error': SubmitClicked & userForm.email. $ Invalid and & amp;; userForm.email. $ Pristine}" & gt; and click the Submit button to set the submit flag to the correct
& lt; Button type = "submit" class = "btn btn-primary btn-large" ng-click = "submit = true" & gt; Submit & lt; / Button & gt; And you can also try it
Comments
Post a Comment