Disable submit input if text input is invalid
Description
The following code shows how to Disable submit input if text input is invalid.
Example
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
</head><!--from w w w.j av a 2 s.co m-->
<body>
<form ng-app name="myForm">
<label>Name</label>
<input type="text" name="name" ng-model="form.name" required>
<input type="submit" ng-disabled="myForm.name.$invalid">
</form>
</body>
</html>