Ng-submit doesn't work when enter key is pressed from focused input
For some reason, when I press the enter button after hiding the input, the function submit_form()
doesn't fire. Anyone have any ideas as to why this won't work?
<form name="theform" ng-submit="submit_form()" novalidate>
<div ng-hide="show_form">
<div ng-click="show_input()">Click me</div>
</div>
<div ng-show="show_form">
<input type="text" class="md_input" ng-model="inputstuff" placeholder="name" required />
</div>
</form>
Internal controller:
$scope.show_form = false;
$scope.show_input = function() { $scope.show_form = true; }
$scope.submit_form = function() { console.log("TRIGGER"); }
+3
source to share
No one has answered this question yet
Check out similar questions: