Try it
Javascript
Jquery
Angular
Learn Angular
Learn Javascript
Learn Bootstrap
Learn jQuery
Ng-Form-6
In this example when user interact with the form,value of the $dirty becomes true and button gets enable.
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="app"> <div ng-controller="controllerName"> <ng-form name="myForm" novalidate> <label>User Name</label> <input type="text" required ng-model="uName" name="name" /> <br /> <label>Email</label> <input type="email" required ng-model="email" name="age" /> <br /> <input type="button" ng-disabled="!myForm.$dirty" ng-click="click()" value="click" /> </ng-form> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.uName = "LearnIt"; $scope.email = "
[email protected]
"; }]); </script> </body> </html>
Output
×
Save This try
Title
Description
In this example when user interact with the form,value of the $dirty becomes true and button gets enable.