简体   繁体   English

Django表单向导的可单击导航

[英]Clickable Navigation for Django Form Wizard

I've a working form wizard, but I now need a navigation for the various sections/steps of the wizard. 我有一个工作表单向导,但是现在需要导航向导的各个部分/步骤。

For example, I have something like an application form and there are multiple sections like Personal Details, Academics, etc; 例如,我有一份申请表,并且有多个部分,例如“个人详细信息”,“学术”等; each of which is a wizard step. 每个步骤都是一个向导步骤。 I'm looking for ways to implement a navigation menu for this wizard. 我正在寻找实现此向导导航菜单的方法。 Clicking on each of the links should take me to the corresponding step. 单击每个链接应将我带到相应的步骤。

This seems like a fairly common usecase, when dealing with larger forms, but no obvious solution. 在处理较大的表单时,这似乎是一个相当普遍的用例,但没有明显的解决方案。

How can I go about doing this? 我该怎么做呢?

I've got a step in a form wizard which shows you the information entered, much like a review screen, where I do this. 我在表单向导中走了一步,该向导向您显示输入的信息,就像在检查屏幕上一样。

This is the markup I use; 这是我使用的标记;

<h2>Personal Information
    <span>
        <button name="wizard_goto_step" type="submit"
                value="1">
            (Edit details)
        </button>
    </span>
</h2>

Essentially what you need to do, is send wizard_goto_step to the view, with value defined as whichever step in the wizard you want to go to. 本质上,您需要执行的操作是将wizard_goto_step发送到视图,并将其value定义为您要转到向导中的任一步骤。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM