How to add Next and Previous Buttons to Tabs in PDF Templates

Modified on Mon, May 27, 2019 at 12:21 PM

The code below creates three tabs. The first one will get a Next button only, the second tab will get Next and Previous buttons. The third tab has Previous button only. The code for the buttons is in red.

<div class="row ep-fields-container" style="margin-bottom:10px;">
    <ul Class="nav nav-tabs" role="tablist">

        <li role="presentation" class="active"><a href="#tab1" aria-controls="Tab 1" role="tab" data-toggle="tab">Tab 1</a></li>
<li role="presentation"><a href="#tab2" aria-controls="Tab 2" role="tab" data-toggle="tab">Tab 2</a></li>
<li role="presentation"><a href="#tab3" aria-controls="Tab 3" role="tab" data-toggle="tab">Tab 3</a></li>
</ul>
<div class="tab-content" style="min-height: 400px; position: relative;">
<div role="tabpanel" class="row tab-pane active" id="tab1">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-4 text-right">Leader</div>
<div class="col-sm-8">{Leader}</div>
</div>
</div>
<div class="col-sm-12">
<div class="row">
<div class="col-sm-4 text-right">WebSite</div>
<div class="col-sm-8">{WebSite}</div>
</div>
</div>
<div class="col-sm-12 text-center" style="position:absolute; bottom:0">
<a class="btn btn-primary btn-sm btnNext">Next</a>
</div>
</div>
<div role="tabpanel" class="row tab-pane" id="tab2">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-4 text-right">Job Title</div>
<div class="col-sm-8">{Job Title}</div>
</div>
</div>
<div class="col-sm-12 text-center" style="position:absolute; bottom:0">
<a class="btn btn-primary btn-sm btnPrevious">Previous</a>
<a class="btn btn-primary btn-sm btnNext">Next</a>
</div>
</div>
<div role="tabpanel" class="row tab-pane" id="tab3">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-4 text-right">Name</div>
<div class="col-sm-8">{Name}</div>
</div>
</div>
<div class="col-sm-12 text-center" style="position:absolute; bottom:0">
<a class="btn btn-primary btn-sm btnPrevious">Previous</a>
</div>
</div>
</div>
</div>

<script>
$('.btnNext').click(function(){
$('.nav-tabs > .active').next('li').find('a').trigger('click');
        });      

      $('.btnPrevious').click(function(){
$('.nav-tabs > .active').prev('li').find('a').trigger('click');
});
</script>


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article