Directive ng-submit in sngularjs
This sample will help you know about using ng-submit in AngularJS.
<html> <head> <title>Angular JS Model</title> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <script> angular.module('MyForm', []) .controller('myController', ['$scope', function($scope) { $scope.login = function () { if ($scope.username == 'admin' && $scope.password == '123456') { alert(‘Login successfully.’); } else { alert('Login failed.'); } }; }]); </script> </head> <body ng-app="MyForm" name = “myform”
ng-submit
="login()" > User name: <br /> <input type="text" name="userName" ng-pattern="/^([a-zA-Z0-9]+)$/" ng-model="username" ng-trim="true" required ng-minlength="3" ng-maxlength="10" /> <br /> Password: <br /> <input type="text" name="userPass" ng-model="password" required ng-minlength="3" ng-maxlength="10" ng-trim="true"> <br /><br /> <input type="submit" value='Login' /> </body> </html>
ng pattern angularjs submit form , jquery in array tutorial to check value.
ReplyDeleteinarray jquery
jquery find in array
jquery find in array of objects
jQuery.inArray() JavaScript
Check if value exists jQuery in Array
checking for a value in array jquery
javascript jquery in array
jquery inarray object
inarray jquery
inarray jquery