angularjs - Autocomplete="on" not working in chrome, on Angular ng-submit -
i submitting angular form using ng-submit. code working on.
<form class="awesome-form" id="loginform" name="loginform" ng-submit="submit();" novalidate> <div class="input-group"> <input id="loginemailaddress" name="loginemailaddress" ng-model="login.loginid" ng-pattern="/^[_a-za-z0-9]+(\.[_a-za-z0-9]+)*@[a-za-z0-9-]+(\.[a-za-z0-9-]+)*(\.[a-za-z]{2,4})$/" ng-keyup = "checktype($event,'login-label');" required="" type="text" autocomplete="on"> <label id="login-label">email</label> </div> <span class="icon-close" ng-show="!loginform.loginemailaddress.$error.required" ng-click="clear()"></span> </div> /*some other form elements come here*/ <button class="login-button-blue" ng-disabled="!(loginform.loginemailaddress.$valid && loginform.loginpassword.$valid)" type="submit">sign in</button> </form>
the submit method calling service in turn sends http post request.
$scope.submit = function() { sampleservice.samplemethod(angular.tojson(request)).then(function(successdata){ /**do something**/ } }
the sampleservice follows:
app.service('sampleservice', ['$http', '$q', function ($http, $q) { this.samplemethod= function (request) { var deferred = $q.defer(); $http.post("url", request).success(function (data, status, headers, config) { deferred.resolve(data); }).error(function (data, status, headers, config) { deferred.reject(data); }); return deferred.promise; }; }]);
after successful submission of form, expect browser's native autocomplete feature work. email address autocompleted when type in next time.
it works successful in firefox, not in chrome. tried several methods mentioned in other stack overflow questions. solutions proved useless.
(trigger autocomplete without submitting form)
a fiddle has been given in solution question worked in browsers(http://jsfiddle.net/6cve0z98/). not working me.
- i using chrome version 41.0.2272.118.
- a post method used.
is problem browser or doing wrong? me solution. in advance.
Comments
Post a Comment