[英]How to create Multi step form
We want to give option to author to create multi steps tabs or wizard.我们希望为作者提供创建多步骤选项卡或向导的选项。 This number of steps/tabs should be configurable in Form Start component in Edit button.
这个步骤/选项卡的数量应该在“编辑”按钮的“表单启动”组件中进行配置。 Once author selects the number of steps/tabs then steps/tabs will be created automatically and then author can drag and drop other components like "File Upload", etc.. Please refer to the attached screenshot.
一旦作者选择了步骤/选项卡的数量,将自动创建步骤/选项卡,然后作者可以拖放其他组件,如“文件上传”等。请参阅附件截图。
Kindly let me know how to proceed on this.请让我知道如何进行。
You can try to leverage the OOTB tabctrl component provided in geometrixx-outdoors along with the OOTB form component.您可以尝试利用 geometrixx-outdoors 中提供的 OOTB tabctrl组件以及 OOTB 表单组件。 The only customization needed would be changing the form end component to accomodate prev and next buttons, and then adding a bit of javascript to navigate the tabs on click of those buttons.
唯一需要的自定义是更改表单结束组件以容纳上一个和下一个按钮,然后添加一些 javascript 以在单击这些按钮时导航选项卡。
Steps to create this.创建此的步骤。
JS: JS:
jQuery(function ($) {
$(document).on('click', '.prev', function(){ // 'prev' is class of previous button
var tabctrl = $(this).closest('form').find('.tabctrl');
var currentItemHeader = $(tabctrl).find(".tabctrl-header li.active");
$(currentItemHeader).prev().find('a').click();
});
$(document).on('click', '.next', function(){ // 'next' is class of next button
var tabctrl = $(this).closest('form').find('.tabctrl');
var currentItemHeader = $(tabctrl).find(".tabctrl-header li.active");
$(currentItemHeader).next().find('a').click();
});
});
NOTE: Try to include the appropriate clientlibs in geometrixx site before testing this, else tabctrl wouldn't work properly.注意:在测试之前尝试在 geometrixx 站点中包含适当的 clientlibs,否则 tabctrl 将无法正常工作。 Or else, you can check this dierctly in geometrixx-outdoors site.
或者,您可以在 geometrixx-outdoors 站点中直接查看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.