gpt4 book ai didi

javascript - 编辑当前表单向导以成功发布数据

转载 作者:行者123 更新时间:2023-11-28 08:42:36 24 4
gpt4 key购买 nike

我正在使用表单向导的 CSS 框架。在向导结束时,它会在当前页面上显示一条消息。我需要将页面重定向到 postData.php 页面,但我遇到了 javascript 问题。下面是相关代码。

<div class="step-content row-fluid position-relative" id="step-container">
<div class="step-pane active" id="step1">
<h3 class="lighter block green">What Services Are Needed?</h3>
<form class="form-horizontal" action = "http://path/postDataPage.php" id="validation-form" method="post">
<div class="form-group">
<div class="col-xs-12 col-sm-9">
<div>
<label class="blue">
<input name="radPag1" value="1" type="radio" class="ace" />
<span class="lbl">Radio Option</span>
</label>
</div>
</div>
</div>
</form>
</div>
<div class="step-pane" id="step2">
<div class="row-fluid">
<div class="form-group">
<div class="col-xs-12 col-sm-9">
<div>
<label class="blue">
<input name="radPag2" value="1" type="radio" class="ace" />
<span class="lbl">Radio Option</span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid wizard-actions">
<button class="btn btn-prev">Prev</button>
<button class="btn btn-success btn-next" data-last="Finish ">Next</button>
</div>

<script type="text/javascript">
jQuery(function($) {
var $validation = false;
$('#fuelux-wizard').ace_wizard().on('change' , function(e, info){
if(info.step == 1 && $validation) {
if(!$('#validation-form').valid()) return false;
}
}).on('finished', function(e) {
bootbox.dialog({
message: "Thank you! Your information was successfully saved!",
buttons: {
"success" : {
"label" : "OK",
"className" : "btn-sm btn-primary"
}
}
});
}).on('stepclick', function(e){
//return false;//prevent clicking on steps
});
$('#modal-wizard .modal-header').ace_wizard();
$('#modal-wizard .wizard-actions .btn[data-dismiss=modal]').removeAttr('disabled');
})
</script>

任何人都可以提供一些关于如何调整 JavaScript 的建议,以便最后将数据发送到下一页吗?

最佳答案

<script type="text/javascript">
jQuery(function($) {
var $validation = false;
$('#fuelux-wizard').ace_wizard().on('change' , function(e, info){
if(info.step == 1 && $validation) {
if(!$('#validation-form').valid()) return false;
}
}).on('finished', function(e) {
$('#validation-form').submit();
}).on('stepclick', function(e){
//return false;//prevent clicking on steps
});
$('#modal-wizard .modal-header').ace_wizard();
$('#modal-wizard .wizard-actions .btn[data-dismiss=modal]').removeAttr('disabled');
})
</script>

关于javascript - 编辑当前表单向导以成功发布数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20323828/

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