Created
December 13, 2014 14:24
-
-
Save got5/fabd51ee4221ebfc347a to your computer and use it in GitHub Desktop.
Slide 144 Using form validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="myForm"> | |
<h3>Training complaint form</h3> | |
<alert type="error" ng-if="myForm.txtContent.$error.maxlength"> | |
Complaint message must be five characters long or less! | |
</alert> | |
Your name: <input type="text" name="inputName" ng-model="complaint.name" ng-required="true" /> | |
Your mail: <input type="email" ng-required="true" name="inputMail" ng-model="complaint.mail" /> | |
Your complaint: <input type="text" name="txtContent" ng-maxlength="5" ng-model="complaint.content" /> | |
<button ng-disabled="!myForm.$valid" class="btn" ng-click="sendComplaint()">Send</button> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment