我已经安装了 jQuery 步骤,并且想使用步骤向导制作一个表单。问题是当“完成”按钮出现时如何用 PHP 汇总表单。下面的所有代码都有效,除了最后一次提交的处理。
我的表单示例代码:
<form method="POST" action="#" role="form">
<div id="wizard">
<h2>Info</h2>
<section>
<div class="form-group">
<label for="text">Email address:</label>
<input type="text" class="form-control" id="text">
</div>
</section>
<h2>Second Step</h2>
<section>
//form stuff
</section>
<h2>Third Step</h2>
<section>
//form stuff
</section>
<h2>Forth Step</h2>
<section>
form stuff
</section>
</div>
</form>
调用 jQuery 步骤的脚本:
<script>
$(function ()
{
$("#wizard").steps({
headerTag: "h2",
bodyTag: "section",
transitionEffect: "slideLeft",
stepsOrientation: "vertical"
});
});
</script>
最后,我想使用 PHP 将表单向导汇总到 db:
<?php
if(isset($_POST['submit'])){
//save values
}
?>