Different buttons on click opens different tab but inside the same modalBootstrap toggle button works only once when clickedInside a remote modal, a link to another URL to be opened in the same modalAngularJS open modal dialog on button clickJquery to open Bootstrap v3 modal of remote urlBinding event before bootstrap modal showHow to click a button inside a modal after opens it?Bootstrap Modal Open Different Section Of ModalModal button click requiredHow to open a particular tab inside a modalA Bootstrap modal window not open using JQuery

How can Schrödinger's cat be both dead and alive?

What makes things real?

Equilibrium points of bounce/instanton solution after Wick's rotation

Need help to understand the integral rules used solving the convolution of two functions

How to calculate the proper layer height multiples?

Is there a "right" way to interpret a novel, if not, how do we make sure our novel is interpreted correctly?

Gap in tcolorbox after title

How do you say "to hell with everything" in French?

How to find a reviewer/editor for my paper?

Bacteria vats to generate edible biomass, require intermediary species?

What makes an ending "happy"?

The pirate treasure of Leatherback Atoll

Walking on an infinite grid

How to descend a few exposed scrambling moves with minimal equipment?

How should we understand "unobscured by flying friends" in this context?

How to capture c-lightining logs?

Who is the uncredited actor leading the squad in the Valerian movie?

What is the difference between a translation and a Galilean transformation?

How strong is aircraft-grade spruce?

Does the 2019 UA artificer need to prepare the Lesser Restoration spell to cast it with their Alchemical Mastery feature?

What can we do about our 9-month-old putting fingers down his throat?

Problem with listing a directory to grep

Do you need to burn fuel between gravity assists?

Was Robin Hood's point of view ethically sound?



Different buttons on click opens different tab but inside the same modal


Bootstrap toggle button works only once when clickedInside a remote modal, a link to another URL to be opened in the same modalAngularJS open modal dialog on button clickJquery to open Bootstrap v3 modal of remote urlBinding event before bootstrap modal showHow to click a button inside a modal after opens it?Bootstrap Modal Open Different Section Of ModalModal button click requiredHow to open a particular tab inside a modalA Bootstrap modal window not open using JQuery






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















So, I have two different buttons for example A & B. I have one modal - inside which there are two tabs called a & b.
I want to click A to open the a tab inside the modal and clicking B should open the b tab inside the same modal.






<script>
$("#loginBtn").on('click', function ()
$('.nav-tabs a[href="#details_$offer->id"]').tab('show');
)
$("#regBtn").on('click', function ()
$('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
)
</script>

<div class="pp-offer-btn">
@if($offer->offer_full_description != null)
<button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
@endif
<button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
</div>
<div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;</button>
<h4 class="modal-title" id="myModalLabel">
partner name
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<!-- Nav tabs -->
<ul class="nav nav-tabs">
<li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
<li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
</ul>
<!-- Tab panes -->
<!--LOGIN TAB -->
<div class="tab-content">
<div class="tab-pane active" id="details_$offer->id">
<div class="modal-body" style="padding-left: 2em;">
!! html_entity_decode($offer->offer_full_description) !!
</div>
<div id="tabloginMsg"></div>
</div>
<div class="tab-pane" id="tnc_$offer->id">
<div class="modal-body" style="padding-left: 2em;">
!! html_entity_decode($offer->tnc) !!
</div>
<div id="tabregMsg"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>





I searched stack overflow for similar problems and found one but it's buggy
https://jsfiddle.net/a5voyotu/
It serves my purpose but cutting the modal and clicking on the buttons show wrong body of the tabs.










share|improve this question
































    0















    So, I have two different buttons for example A & B. I have one modal - inside which there are two tabs called a & b.
    I want to click A to open the a tab inside the modal and clicking B should open the b tab inside the same modal.






    <script>
    $("#loginBtn").on('click', function ()
    $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
    )
    $("#regBtn").on('click', function ()
    $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
    )
    </script>

    <div class="pp-offer-btn">
    @if($offer->offer_full_description != null)
    <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
    @endif
    <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
    </div>
    <div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
    <div class="modal-content">
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
    &times;</button>
    <h4 class="modal-title" id="myModalLabel">
    partner name
    </div>
    <div class="modal-body">
    <div class="row">
    <div class="col-md-12">
    <!-- Nav tabs -->
    <ul class="nav nav-tabs">
    <li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
    <li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
    </ul>
    <!-- Tab panes -->
    <!--LOGIN TAB -->
    <div class="tab-content">
    <div class="tab-pane active" id="details_$offer->id">
    <div class="modal-body" style="padding-left: 2em;">
    !! html_entity_decode($offer->offer_full_description) !!
    </div>
    <div id="tabloginMsg"></div>
    </div>
    <div class="tab-pane" id="tnc_$offer->id">
    <div class="modal-body" style="padding-left: 2em;">
    !! html_entity_decode($offer->tnc) !!
    </div>
    <div id="tabregMsg"></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>





    I searched stack overflow for similar problems and found one but it's buggy
    https://jsfiddle.net/a5voyotu/
    It serves my purpose but cutting the modal and clicking on the buttons show wrong body of the tabs.










    share|improve this question




























      0












      0








      0








      So, I have two different buttons for example A & B. I have one modal - inside which there are two tabs called a & b.
      I want to click A to open the a tab inside the modal and clicking B should open the b tab inside the same modal.






      <script>
      $("#loginBtn").on('click', function ()
      $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
      )
      $("#regBtn").on('click', function ()
      $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
      )
      </script>

      <div class="pp-offer-btn">
      @if($offer->offer_full_description != null)
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
      @endif
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
      </div>
      <div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
      &times;</button>
      <h4 class="modal-title" id="myModalLabel">
      partner name
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-md-12">
      <!-- Nav tabs -->
      <ul class="nav nav-tabs">
      <li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
      <li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
      </ul>
      <!-- Tab panes -->
      <!--LOGIN TAB -->
      <div class="tab-content">
      <div class="tab-pane active" id="details_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->offer_full_description) !!
      </div>
      <div id="tabloginMsg"></div>
      </div>
      <div class="tab-pane" id="tnc_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->tnc) !!
      </div>
      <div id="tabregMsg"></div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>





      I searched stack overflow for similar problems and found one but it's buggy
      https://jsfiddle.net/a5voyotu/
      It serves my purpose but cutting the modal and clicking on the buttons show wrong body of the tabs.










      share|improve this question
















      So, I have two different buttons for example A & B. I have one modal - inside which there are two tabs called a & b.
      I want to click A to open the a tab inside the modal and clicking B should open the b tab inside the same modal.






      <script>
      $("#loginBtn").on('click', function ()
      $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
      )
      $("#regBtn").on('click', function ()
      $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
      )
      </script>

      <div class="pp-offer-btn">
      @if($offer->offer_full_description != null)
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
      @endif
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
      </div>
      <div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
      &times;</button>
      <h4 class="modal-title" id="myModalLabel">
      partner name
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-md-12">
      <!-- Nav tabs -->
      <ul class="nav nav-tabs">
      <li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
      <li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
      </ul>
      <!-- Tab panes -->
      <!--LOGIN TAB -->
      <div class="tab-content">
      <div class="tab-pane active" id="details_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->offer_full_description) !!
      </div>
      <div id="tabloginMsg"></div>
      </div>
      <div class="tab-pane" id="tnc_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->tnc) !!
      </div>
      <div id="tabregMsg"></div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>





      I searched stack overflow for similar problems and found one but it's buggy
      https://jsfiddle.net/a5voyotu/
      It serves my purpose but cutting the modal and clicking on the buttons show wrong body of the tabs.






      <script>
      $("#loginBtn").on('click', function ()
      $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
      )
      $("#regBtn").on('click', function ()
      $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
      )
      </script>

      <div class="pp-offer-btn">
      @if($offer->offer_full_description != null)
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
      @endif
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
      </div>
      <div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
      &times;</button>
      <h4 class="modal-title" id="myModalLabel">
      partner name
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-md-12">
      <!-- Nav tabs -->
      <ul class="nav nav-tabs">
      <li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
      <li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
      </ul>
      <!-- Tab panes -->
      <!--LOGIN TAB -->
      <div class="tab-content">
      <div class="tab-pane active" id="details_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->offer_full_description) !!
      </div>
      <div id="tabloginMsg"></div>
      </div>
      <div class="tab-pane" id="tnc_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->tnc) !!
      </div>
      <div id="tabregMsg"></div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>





      <script>
      $("#loginBtn").on('click', function ()
      $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
      )
      $("#regBtn").on('click', function ()
      $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
      )
      </script>

      <div class="pp-offer-btn">
      @if($offer->offer_full_description != null)
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="loginBtn" data-target="#offerDetails_$offer->id">Details</button>
      @endif
      <button class="btn btn-primary" data-toggle="modal" style="cursor:pointer" id="regBtn" data-target="#offerDetails_$offer->id">T&C</button>
      </div>
      <div class="modal" id="offerDetails_$offer->id" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-lg">
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
      &times;</button>
      <h4 class="modal-title" id="myModalLabel">
      partner name
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-md-12">
      <!-- Nav tabs -->
      <ul class="nav nav-tabs">
      <li id="loginLi"><a href="#details_$offer->id" data-toggle="tab">Details</a></li>
      <li id="RegLi"><a href="#tnc_$offer->id" data-toggle="tab">T&C</a></li>
      </ul>
      <!-- Tab panes -->
      <!--LOGIN TAB -->
      <div class="tab-content">
      <div class="tab-pane active" id="details_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->offer_full_description) !!
      </div>
      <div id="tabloginMsg"></div>
      </div>
      <div class="tab-pane" id="tnc_$offer->id">
      <div class="modal-body" style="padding-left: 2em;">
      !! html_entity_decode($offer->tnc) !!
      </div>
      <div id="tabregMsg"></div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>






      html5 bootstrap-modal






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 29 at 11:56







      Tanha Islam

















      asked Mar 28 at 7:34









      Tanha IslamTanha Islam

      66 bronze badges




      66 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          0
















          Can you try this? Hope this works ;)



          $("#loginBtn").on('click', function () 
          $('.nav-tabs a[href="#Login"]').tab('show');
          )
          $("#regBtn").on('click', function ()
          $('.nav-tabs a[href="#Registration"]').tab('show');
          )





          share|improve this answer



























          • I tried implementing this, but both the buttons open to the first tab instead of different tabs.

            – Tanha Islam
            Mar 29 at 8:10











          • I just update the code.

            – Vinh Can Code
            Mar 29 at 8:51











          • Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

            – Tanha Islam
            Mar 29 at 11:46



















          0
















          I think that you put the code in .ready function that may work fine
          Or call rebind onclicks when the document is ready:



          <script>
          $( document ).ready(function()
          $("#loginBtn").on('click', function ()
          $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
          );
          $("#regBtn").on('click', function ()
          $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
          );

          );
          </script>





          share|improve this answer



























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392283%2fdifferent-buttons-on-click-opens-different-tab-but-inside-the-same-modal%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0
















            Can you try this? Hope this works ;)



            $("#loginBtn").on('click', function () 
            $('.nav-tabs a[href="#Login"]').tab('show');
            )
            $("#regBtn").on('click', function ()
            $('.nav-tabs a[href="#Registration"]').tab('show');
            )





            share|improve this answer



























            • I tried implementing this, but both the buttons open to the first tab instead of different tabs.

              – Tanha Islam
              Mar 29 at 8:10











            • I just update the code.

              – Vinh Can Code
              Mar 29 at 8:51











            • Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

              – Tanha Islam
              Mar 29 at 11:46
















            0
















            Can you try this? Hope this works ;)



            $("#loginBtn").on('click', function () 
            $('.nav-tabs a[href="#Login"]').tab('show');
            )
            $("#regBtn").on('click', function ()
            $('.nav-tabs a[href="#Registration"]').tab('show');
            )





            share|improve this answer



























            • I tried implementing this, but both the buttons open to the first tab instead of different tabs.

              – Tanha Islam
              Mar 29 at 8:10











            • I just update the code.

              – Vinh Can Code
              Mar 29 at 8:51











            • Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

              – Tanha Islam
              Mar 29 at 11:46














            0














            0










            0









            Can you try this? Hope this works ;)



            $("#loginBtn").on('click', function () 
            $('.nav-tabs a[href="#Login"]').tab('show');
            )
            $("#regBtn").on('click', function ()
            $('.nav-tabs a[href="#Registration"]').tab('show');
            )





            share|improve this answer















            Can you try this? Hope this works ;)



            $("#loginBtn").on('click', function () 
            $('.nav-tabs a[href="#Login"]').tab('show');
            )
            $("#regBtn").on('click', function ()
            $('.nav-tabs a[href="#Registration"]').tab('show');
            )






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 29 at 8:51

























            answered Mar 28 at 8:07









            Vinh Can CodeVinh Can Code

            3062 silver badges11 bronze badges




            3062 silver badges11 bronze badges















            • I tried implementing this, but both the buttons open to the first tab instead of different tabs.

              – Tanha Islam
              Mar 29 at 8:10











            • I just update the code.

              – Vinh Can Code
              Mar 29 at 8:51











            • Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

              – Tanha Islam
              Mar 29 at 11:46


















            • I tried implementing this, but both the buttons open to the first tab instead of different tabs.

              – Tanha Islam
              Mar 29 at 8:10











            • I just update the code.

              – Vinh Can Code
              Mar 29 at 8:51











            • Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

              – Tanha Islam
              Mar 29 at 11:46

















            I tried implementing this, but both the buttons open to the first tab instead of different tabs.

            – Tanha Islam
            Mar 29 at 8:10





            I tried implementing this, but both the buttons open to the first tab instead of different tabs.

            – Tanha Islam
            Mar 29 at 8:10













            I just update the code.

            – Vinh Can Code
            Mar 29 at 8:51





            I just update the code.

            – Vinh Can Code
            Mar 29 at 8:51













            Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

            – Tanha Islam
            Mar 29 at 11:46






            Hello again, this(the updated code which you gave me) works for static items but when I am trying to put dynamic values this isn't working anymore. I have updated my code please have a look.

            – Tanha Islam
            Mar 29 at 11:46














            0
















            I think that you put the code in .ready function that may work fine
            Or call rebind onclicks when the document is ready:



            <script>
            $( document ).ready(function()
            $("#loginBtn").on('click', function ()
            $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
            );
            $("#regBtn").on('click', function ()
            $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
            );

            );
            </script>





            share|improve this answer





























              0
















              I think that you put the code in .ready function that may work fine
              Or call rebind onclicks when the document is ready:



              <script>
              $( document ).ready(function()
              $("#loginBtn").on('click', function ()
              $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
              );
              $("#regBtn").on('click', function ()
              $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
              );

              );
              </script>





              share|improve this answer



























                0














                0










                0









                I think that you put the code in .ready function that may work fine
                Or call rebind onclicks when the document is ready:



                <script>
                $( document ).ready(function()
                $("#loginBtn").on('click', function ()
                $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
                );
                $("#regBtn").on('click', function ()
                $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
                );

                );
                </script>





                share|improve this answer













                I think that you put the code in .ready function that may work fine
                Or call rebind onclicks when the document is ready:



                <script>
                $( document ).ready(function()
                $("#loginBtn").on('click', function ()
                $('.nav-tabs a[href="#details_$offer->id"]').tab('show');
                );
                $("#regBtn").on('click', function ()
                $('.nav-tabs a[href="#tnc_$offer->id"]').tab('show');
                );

                );
                </script>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 29 at 13:47









                Vinh Can CodeVinh Can Code

                3062 silver badges11 bronze badges




                3062 silver badges11 bronze badges































                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392283%2fdifferent-buttons-on-click-opens-different-tab-but-inside-the-same-modal%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현