gpt4 book ai didi

javascript - 当表单可见时如何提交按钮

转载 作者:行者123 更新时间:2023-12-03 11:06:28 25 4
gpt4 key购买 nike

如果用户验证正确并且工作正常,我将尝试将用户发送到付款 URL。

但我有另一个从一开始就隐藏的表单,如果验证为真,我会取消隐藏该表单,然后我需要 id 为 #openPaymentButton 的 btn 才能提交

 if(data.success == true)
{
//Vis betalings vindue knap og klik på knappen
$scope.hideEpayBtn = false;
$("#openPaymentButton").click();
console.log('virker');

} else {
alert("Error");
}



<form action="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/Default.aspx" ng-if="hideEpayBtn == false" method="post">
<input ng-hide="hideEpayBtn" id="openPaymentButton" type="submit" value="">


</form>

最佳答案

首先这个问题不太清楚。到目前为止我明白,你正在谈论一些验证。

如果你的问题比较具体,我可以给你一个合适的答案。这个答案是我根据你的问题猜测的。

也许您可以在表单中使用类似的内容

<form name="formName" data-ng-submit="yourfunction(formName.$valid)" novalidate>

<button type="submit" ng-disabled="userForm.$invalid">Submit</button>

</form>

<form action="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/Default.aspx"
data-ng-hide="success == false" method="post">

<input data-ng-hide="success == ''" id="openPaymentButton" type="submit" value="">
</form>

在你的 Angular Controller 中:

$scope.success = false;
$scope.yourfunction= function (isValid) {
if (isValid) {
$scope.success = true;
serviceFor.addNewProject($scope.inputObject);

}
} else {
$scope.success = true;
$scope.failMessage = "Please fill up all the fields";
}
};

这是我对您的要求的最佳猜测。如果可以的话请告诉我。

关于javascript - 当表单可见时如何提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27837468/

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