のボタンを使用して外部のフォームからフォームを送信するためにどのように私は私が私のng-click
書かれている私は角</p> <p>使用<code>next()</code>と<code>saveStep()</code>にフォームを送信する必要があるHTML
フォーム内next()
とsaveStep()
を書き込むことはできません以下
でnext()
とsaveStep()
のために、私はその作業のフォームの内側からフォームをsubmitingていたときに罰金
これは、これがされていないトークン
<div class="content">
<div class="content_wrap">
<div class="content_title centered">Order an SOA</div>
<div class="card">
<div class="card_title title_custom">PAYMENT
<div>Please provide credit card details</div>
</div>
<div class="form_element table_wrap">
<table class="form_element_table center-aligned right-border">
<thead>
<th class="no-background">Order Summary</th>
<th class="no-background">Credit Card Details</th>
</thead>
<tbody>
<tr>
<td>
<div class="inner-table-element">
<div class="inner-table-cell">Advice - SMSF Establishment</div>
<div class="inner-table-cell small">$ {{smf_Fee}}</div>
</div>
<div class="inner-table-element">
<div class="inner-table-cell">Advice - Property in Super</div>
<div class="inner-table-cell small">$ {{buy_property_Fee}}</div>
</div>
<div class="inner-table-element top-border">
<div class="inner-table-cell">Total</div>
<div class="inner-table-cell small">$ {{totalFee}}</div>
</div>
</td>
<!--<td>-->
<!--<div class="inner-table-element front-space">-->
<!--<div class="inner-table-cell">Card Number</div>-->
<!--<div class="inner-table-cell align-right"><input type="text" ng-model="step6.cardNumber"/></div>-->
<!--</div>-->
<!--<div class="inner-table-element front-space">-->
<!--<div class="inner-table-cell">CVC</div>-->
<!--<div class="inner-table-cell align-right"><input type="text" ng-model="step6.cvc"/></div>-->
<!--</div>-->
<!--<div class="inner-table-element front-space">-->
<!--<div class="inner-table-cell">Expiry (MM/YY)</div>-->
<!--<div class="inner-table-cell align-right"><input type="text" ng-model="step6.expiry"/></div>-->
<!--</div>-->
<!--</td>-->
<td>
<form action="/plan/account/charge" method="POST" id="payment-form">
<div class="inner-table-element front-space">
<div class="inner-table-cell">Card Number</div>
<div class="inner-table-cell align-right">
<input class="card_number" type="text" size="20" data-stripe="number" placeholder="Card Number" />
</div>
</div>
<div class="inner-table-element front-space">
<div class="inner-table-cell">CVC</div>
<div class="inner-table-cell align-right">
<input class="cvc" type="text" size="4" data-stripe="cvc" placeholder="CVC" />
</div>
</div>
<div class="inner-table-element front-space">
<div class="inner-table-cell">Expiry</div>
<div class="inner-table-cell align-right">
<input class="payment_text exp_month expiry" type="text" size="2" data-stripe="exp-month" placeholder="MM" />
<span>/</span>
<input class="payment_text exp_year expiry" type="text" size="4" data-stripe="exp-year" placeholder="YYYY" />
</div>
</div>
</form>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</div>
<div class="form_element nav_btn_wrap">
<div class="btn back-btn" ng-click="back();">
<span>Back</span>
</div>
<div class="btn next-btn" ng-click="saveStep();">
<span>Save</span>
</div>
<div class="btn next-btn" ng-click="next();">
<span>Next</span>
</div>
</div>
</div>
</div>
</div>
accountantApp.controller("step6Controller", function($rootScope, $scope, $http, $location) {
$scope.buy_property_Fee = $rootScope.soaFormData["step1"].buy_property_Fee;
$scope.smf_Fee = $rootScope.soaFormData["step1"].smf_Fee;
$scope.totalFee = $rootScope.soaFormData["step1"].totalFee;
$scope.step6 = {
cardNumber: "",
cvc: "",
expiry: ""
}
$scope.back = function() {
$scope.onBacKEvent();
};
$scope.saveStep = function() {
var count = 0;
$(".form_element_table input").each(function() {
if ($(this).val() == "") {
$(this).css({
"border": "1px solid red"
});
} else {
$(this).css({
"border": "1px solid #CDC5C5"
});
count++;
}
});
if (count != $(".form_element_table input").length) {
$.toast({
heading: 'Error',
text: 'Please fill the fields',
showHideTransition: 'fade',
icon: 'error'
});
return;
}
$rootScope.soaFormData["step6"] = $scope.step6;
$rootScope.stepsCompleted.push("step6");
$rootScope.saveSoa(function(data, status, headers, config) {});
};
$scope.next = function() {
var count = 0;
$(".form_element_table input").each(function() {
if ($(this).val() == "") {
$(this).css({
"border": "1px solid red"
});
} else {
$(this).css({
"border": "1px solid #CDC5C5"
});
count++;
}
});
if (count != $(".form_element_table input").length) {
$.toast({
heading: 'Error',
text: 'Please fill the fields',
showHideTransition: 'fade',
icon: 'error'
});
return;
}
$rootScope.soaFormData["step6"] = $scope.step6;
$rootScope.stepsCompleted.push("step6");
$location.path("/step7");
};
});
あなたの入力にNG-モデルを置く場合は、送信ボタンをどこに置いたか、それは問題ではないだろう。 –
@RaniRadcliffはい、 'はネストされたフォームを送信しますので、問題はありません。' 'それでどこに置いても問題ありませんが、' doSubmit'関数は 'ng-modeled'データを提出する作業をする必要があります。 – plong0