Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is code for the button. I need to link to the next tab in javascript. How do i do that? Thank you in advanced.

What I have tried:

<pre><div id="modal-footer">
              <button type="button" class="btn btn-primary float-right" v-show="prevBtn" @click="navigate('p')">Previous</button>
              <button type="button" class="btn btn-primary float-right" v-show="nextBtn" @click="navigate('n')">Next</button>    
 </div>


1st tab id:
href="#kt_portlet_base_demo_2_1_tab_content"

2nd tab id:
<pre>href="#kt_portlet_base_demo_2_2_tab_content"

3rdt tab id:
<pre>href="#kt_portlet_base_demo_2_3_tab_content"
Posted
Updated 20-Jan-20 20:16pm
Comments
Afzaal Ahmad Zeeshan 7-Oct-19 5:36am    
Perhaps you need to use Bootstrap's JavaScript features in this, while building the view using Vue.js.

Here is a thread that discusses how you can show the tab, javascript - Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink - Stack Overflow[^]

This is a code sample that demonstrates this, https://codepen.io/rnr/pen/dMNZmx[^]
ZurdoDev 7-Oct-19 7:59am    
Depends on what library you are using to create the tabs.

1 solution

if(page == 'n'){
         if (currentTabId == 'firstTab'){

           navigateToTab ='secondTab';
            $("#helpTab a[href='#kt_portlet_base_demo_3_2_tab_content']").tab("show");
         }
         else if (currentTabId == 'secondTab') {
           navigateToTab = 'thirdTab';
            $("#helpTab a[href='#kt_portlet_base_demo_3_3_tab_content']").tab("show");
         }
         else if(currentTabId == 'thirdTab'){
           navigateToTab='fourthTab';
            $("#helpTab a[href='#kt_portlet_base_demo_3_4_tab_content']").tab("show");
         }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900