有没有理由说我的最后一步我打电话确认没有在表格中显示?
<form id="wizardForm" action="" method="post">
<div id="fieldWrapper">
<div class="step" id="first">
<span class="font_normal_07em_black step_title">Site Information</span><br />
<label for="Title">Title</label>
<input id="Title" class="input_field_12em required" type="text" />
<label for="Description">Description</label>
<input id="Description" class="input_field_12em required" type="text" />
<label for="UrlName">Url Name</label>
</div>
<div class="step" id="ownerInfo">
<span class="font_normal_07em_black step_title">Site Owner</span>
<label for="PrimaryOwner">Primary Owner</label>
<input id="PrimaryOwner" class="input_field_12em required" type="text" />
<label for="SecondaryOwner">Secondary Owner (nt id)</label>
<input id="SecondaryOwner" class="input_field_12em required" type="text" />
</div>
<div class="step" id="siteAccess">
<span class="font_normal_07em_black step_title">Site Access</span>
<label for="I">Public or private info <br />
Will private information be stored in this space?</label>
<input id="iYes" name="I" type="radio" value="Yes" />Yes<br />
<input id="iNo" name="I" type="radio" value="No" />No
<hr />
<label for="T">Will T Information be stored on this space?</label>
<input id="TYes" name="T" type="radio" value="Yes" onclick="ToggleT()" />Yes<br />
<input id="TNo" name="T" type="radio" value="No" onclick="ToggleT()" />No
<div id="tAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="tCheckbox" /><span class="checkbox_label">I acknowledge </span>
</div>
<hr />
<label for="C">Will space need to Control content?</label>
<input id="cYes" name="C" type="radio" value="Yes" onclick="ToggleC()" />Yes<br />
<input id="cNo" name="C" type="radio" value="No" onclick="ToggleC()" />No
<div id="cAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="cCheckbox" />
<span class="checkbox_label">I agree </span>
</div>
<hr />
<label for="F">Is Other User Access Required?</label>
<input id="FYes" name="F" type="radio" value="Yes" onclick="ToggleF()" />Yes<br />
<input id="FNo" name="F" type="radio" value="No" onclick="ToggleF()" />No
<div id="fPleaseNoteContainer" class="hidden_contain">
<span class="please_note"><strong>Please Note</strong><br />
</span>
</div>
<hr />
<label for="N">Non Employee(s)?</label>
<input id="NYes" name="N" type="radio" value="Yes" onclick="ToggleN()" />Yes<br />
<input id="NNo" name="N" type="radio" value="No" onclick="ToggleN()" />No
<div id="nAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="nCheckbox" />
<span class="checkbox_label">
I agree
</span>
</div>
</div>
<div class="step" id="siteSharing">
<span class="font_normal_07em_black step_title">Site Sharing</span>
<div class="side_by_side_container">
<div class="left_container">
<input id="SharingRestrictionN2S" name="SharingRestriction" type="radio" value="N2S" />
<span class="generic_label">Public</span><br />
</div>
<div class="right_container">
<input id="SharingRestrictionN2K" name="SharingRestriction" type="radio" value="N2K" />
<span class="generic_label">Private</span><br />
</div>
</div>
</div>
<div class="step" id="agreement">
<span class="font_normal_07em_black step_title">Agreements</span>
<div>
<br />
<div>Business Agreement</div>
<iframe id="bFrame" class="generic_iframe" src="<%= ConfigurationManager.AppSettings["businessUrl"] %>"></iframe>
<br /><br />
<hr />
<br />
<div>Service Agreement</div>
<iframe id="sFrame" class="generic_iframe" src="<%= ConfigurationManager.AppSettings["sericeUrl"] %>"></iframe>
<br /><br />
<hr />
<br />
I agree
</div>
<br />
<input id="sbAggrement" class="required" type="checkbox" />
<span class="checkbox_label">
i agree
</span>
</div>
<div id="final" class="step submit_step">
<span class="font_normal_07em_black step_title">Confirmation</span>
<input type="text" name="temp1" />
</div>
</div>
<br />
<hr class="form_divider" />
<div id="wizardNavigation">
<input class="navigation_button" value="Back" type="reset" />
<input class="navigation_button" value="Next" type="submit" />
</div>
</form>
似乎它在前一步提交,甚至没有达到这一步。我认为你必须包括类步骤和submit_step,因为当我删除“步骤”时,它不会将此添加为另一个向导步骤。如果将其显示在每一步的底部。
同样在最终提交时,有没有人做过任何他们调用ajax来执行提交的内容,这样如果发生错误,用户不会离开页面并仍然将所有数据再次尝试?
我正在使用c#,mvc2并使用Firefox浏览器进行测试
答案 0 :(得分:1)
添加onsubmit =“return false;”到形式,使你可以操纵后期数据
并在jquery中:
$("form").submit(function(){
$.post('postFile....',$(this).serialize(),function(data){
console.log(data);
//do something with data
})
})
答案 1 :(得分:1)
当下一个向导按钮标题时,它将触发
$("#form1").bind("step_shown", function (event, data) {
if (data.currentStep == "Div0") {
//Code that needs to be implemented in the step 0
}
if (data.currentStep == "Div1") {
//Code that needs to be implemented in the step 1
}
});
但是当向导按钮标题是提交时,向导中的最后一步将在下面提到的方法中触发
$("#form1").formwizard({
formPluginEnabled: true,
validationEnabled: true,
focusFirstInput: true,
formOptions: {
success: function (data) {
//Last step completed message
},
beforeSubmit: function (data) {
//Code that need to be implemented for the submit method
},
dataType: 'json',
resetForm: true
}});
请让我知道这是否解决了您的问题。 :)编码:)
答案 2 :(得分:0)
我发现了一个问题。似乎在最终确认步骤之前复选框上的必需类是抛出了一个javascript错误。
<input id="sbAggrement" class="required" type="checkbox" />
我删除了所需的类,单击下一个按钮时会显示最后一步。现在进入下一个问题,为什么复选框上的必需类会抛出一个javascript错误.......
而不是在输入上有所需的类,我将复选框添加到validationOptions,它现在完美地运行