jquery formwizard最后一步不显示

发布于 2024-10-20 19:05:45 字数 6939 浏览 5 评论 0原文

我调用确认的最后一步没有在表单向导中显示有什么原因吗?

        <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,因为当我删除“步骤”时,它不会将其添加为另一个向导步骤。 if 将其显示在每个步骤的底部。

同样在最终提交时,是否有人做了任何调用 ajax 来执行提交的操作,以便在发生错误时用户不会离开页面并且仍然拥有所有数据以再次尝试?

我正在使用 c#、mvc2 并使用 Firefox 浏览器进行测试

is there any reason that my final step i call confirmation isn't showing in the formwizard?

        <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>

seems like it submits on the prior step and doesn't even hit this step. i thought you had to include the class step and submit_step because when i remove "step" it doesn't add this as another wizard step. if displays it on the bottom of every step.

also on the final submit, has anyone done anything where they call ajax to perform the submit so that if an error occurs the user doesn't leave the page and still has all their data to attempt again?

i am using c#, mvc2 and testing with Firefox browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

娇柔作态 2024-10-27 19:05:45

添加 onsubmit="返回 false;"到表单来制作它,这样你就可以

在 jquery 中操作 post 数据:

$("form").submit(function(){
        $.post('postFile....',$(this).serialize(),function(data){
            console.log(data);
            //do something with data
        })
    })

add onsubmit="return false;" to the form to make it so u can manipulate the post data

and in the jquery:

$("form").submit(function(){
        $.post('postFile....',$(this).serialize(),function(data){
            console.log(data);
            //do something with data
        })
    })
踏月而来 2024-10-27 19:05:45

当向导按钮标题为下一个时,它将触发

$("#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
       }});

请告诉我这是否解决了您的问题。
:) 编码:)

When the Wizard button caption is next it will fire the

$("#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
      }
});

But when the Wizard button caption is Submit the final step in Wizard will be fired in the method mentioned bellow

$("#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
       }});

Please let me know has this resolved your issue.
:) Coding :)

淤浪 2024-10-27 19:05:45

我发现了一个问题。似乎在最终确认步骤之前复选框上所需的类抛出了 javascript 错误。

                <input id="sbAggrement" class="required" type="checkbox" />

我删除了所需的类,并在单击下一步按钮时显示最后一步。现在进入下一个问题,为什么复选框上的必需类会抛出 javascript 错误......

而不是在输入上包含必需的类,我将复选框添加到了validationOptions中,现在它工作得很好

i found an issue. it seems that the required class on the checkbox before the final confirmation step was throwing a javascript error.

                <input id="sbAggrement" class="required" type="checkbox" />

i removed the required class and the final step is displayed when the next button is clicked. Now onto the next problem, why is the required class on the checkbox throwing a javascript error.......

instead of having the required class on the input, I added the checkbox to the validationOptions and it works perfectly now

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文