gpt4 book ai didi

javascript - ng-submit 不起作用

转载 作者:行者123 更新时间:2023-12-03 08:00:15 25 4
gpt4 key购买 nike

我有一个表单,但 NG SBMIT 未调用该函数

我不明白为什么这个表单没有提交。我已经检查了所有事情,但它甚至没有调用警报按钮

HTML

 <form role="form" name="frmCashback" method="post" ng-submit="CashbackUser(frmCashback, Rates)">
<!-- Personal Details Start -->
<div class="well">
<legend> Cashback Details </legend>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="Store">Store:</label>
<select name="Store" class="form-control" ng-model="Rates.Store" ng-options="stores.StoreID as stores.StoreName for stores in StoreList" >
<option value="">Select</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Store">Category:</label>
<select name="Category" class="form-control" ng-model="Rates.Category" ng-options="Cate.CategoryID as Cate.CategoryName for Cate in CategoryList" >
<option value="">Select</option>
</select>
</div>
<!-- Modal -->
<!---------Model End-------->
</div>
<div class="col-md-4">
<div class="form-group">
<label for="usr">Cash Back Rate:</label>
<input type="text" class="form-control" name="Cashback" id="Cashback" ng-model="Rates.Cashback" required>
</div>
</div>
</div>
<!---------Model End-------->
</div>
</div>
<div class="row">
<div class="col-md-12">
<button class="btn btn-primary" type="submit">Add Cashback</button>
</div>
</div>
</div>
<!-- Personal Details End -->
</form>

这是我的 Controller

Controller

$scope.CashbackUser = function(frm, Rates) {

alert('Hi');

//query_params.Status = CheckStatus.Action;
//console.log(Rates);

}

我有支票:

function is within the controller I am figthing with this for 4 hr kindly help me.

最佳答案

您的模板似乎有错误,如果您的模板有错误,表单提交将无法工作

<!---------Model End-------->
</div>
</div>

关于javascript - ng-submit 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34618098/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com