编辑当前表单向导以成功发布数据
Edit current form wizard to successfully post data
我正在为表单向导使用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>
jQuery是不必要的,window.location.replace(…)将最好地模拟HTTP重定向。
//类似于HTTP重定向的行为
window.location.replace("postData.php");
//类似于点击链接的行为
window.location.href = "postData.php";
相关文章:
- 用程序搜索JQuery数据表中的文本
- 要求输入在数据列表中
- 正在将数据主题添加到所有项目
- 函数参数中的数据与指定变量之间的任何性能差异
- 在VanillaJS中模拟模型双向数据绑定
- CSS-如何定位内容数据标题
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 无法在数据endVal中设置值=“”;{{ucount}}”;使用Angular JS的CountUp
- 序列化数据属性中对象的最可靠方法
- 如何将JSON数据导入我的ejs模板
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 画布数据到图像
- Highcharts系列.数据数据类型限制
- 在jQuery mobile/java脚本的TextBoxes中动态添加未加载的数据.数据具有[object HTMLI
- 严格模式下的图像数据数据分配
- 具有持久数据(数据存储)的Chrome扩展程序
- Java客户端卡在来自nodejs服务器的数据数据流中
- 高级javascript源数据-数据表
- 在 HTML (SVG) 元素中包含数据/数据密钥