簡體   English   中英

多頁表格 html javascript

[英]multi page form html javascript

我想創建一個多頁表單,其中只有我的第一頁不應該顯示 tab-pill,其余頁面應該顯示標簽但沒有第一頁標簽。

要導航到第一頁,僅應使用第二頁中的上一個按鈕。

我正在使用材料引導向導。

多頁向導的第一頁不應有導航選項卡 只有 2 個標簽應該在那里,上一個按鈕仍然應該帶你到 1page

代碼筆鏈接

 $('.wizard-card').bootstrapWizard({... // Class dn: display:none onTabShow: .... if($current == 1){ console.log('first tab'); console.log(navigation.parent().addClass('dn')); console.log(tab); }else{ navigation.parent().removeClass('dn') }... //This is the JS code i wrote to hide the navigation bar in the first page

使用一些 css 和onInitonNextonPrevious您可以滿足您的需求:

首先要避免第一個選項卡單擊將指針事件設置為無,如下所示:

.wizard-navigation ul li:first-child {
   pointer-events:none;
   visibility:hidden
}

然后你必須隱藏向導初始化的選項卡:

onInit : function(tab, navigation, index){
      $(".wizard-navigation").hide(); // hiding tab wizard
      //... rest of code 
},

然后在 onNext 顯示導航選項卡:

然后你必須隱藏向導初始化的選項卡:

onNext : function(tab, navigation, index){
      $(".wizard-navigation").show(); // shiing tab wizard
      //... rest of code 
},

然后在 onPrevious 檢查 index === 0 然后再次隱藏它

onPrevious : function(tab, navigation, index){
     if(index === 0) $(".wizard-navigation").hide(); // hiding tab wizard
      //... rest of code 
},

這是一支

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM