Javascript 如何使用“提交表格”;输入“;在AngularJS?
我有一个没有提交按钮的搜索表单。如何发送到Javascript 如何使用“提交表格”;输入“;在AngularJS?,javascript,angularjs,form-submit,enter,Javascript,Angularjs,Form Submit,Enter,我有一个没有提交按钮的搜索表单。如何发送到#/结果,是否按enter键 HTML: 要使用ENTER键提交表单,您需要一个提交按钮。如果您不想要,一个棘手的方法是在表单中添加一个不可见的按钮: <form ng-submit="redirect()"> ... <input type="submit" style="visibility: hidden"/> </form> $scope.redirect = function() {
#/结果
,是否按enter键
HTML:
要使用ENTER键提交表单,您需要一个提交按钮。如果您不想要,一个棘手的方法是在表单中添加一个不可见的按钮:
<form ng-submit="redirect()">
...
<input type="submit" style="visibility: hidden"/>
</form>
$scope.redirect = function() {
$location.href('/result');
}
要使用ENTER键提交表单,您需要一个提交按钮。如果您不想要,一个棘手的方法是在表单中添加一个不可见的按钮:
<form ng-submit="redirect()">
...
<input type="submit" style="visibility: hidden"/>
</form>
$scope.redirect = function() {
$location.href('/result');
}
Me不能使用
,因为当用户按输入时,提交自动激活。Me不能使用
,因为当用户按输入时,提交自动激活。