Ved21212
6 months ago
1700
6
Laravel

Bootstrap tab - all tabs active inside foreach

Posted 6 months ago by Ved21212

Hello Team, I am trying to get a tab view where on the click of a tab I can get fields for that very language in the language_name whose id is {{$lang['id']}} . But with the following code I get all the tab-pane inside the foreach as active. How can I get the fields based on the Id

        <div class="panel-heading">
            @lang('global.app_create')

            <ul class="nav nav-tabs">
                @foreach ($languagefinder as $lang)
                    <li class="nav-item">
                        <a class="nav-link" data-toggle="tab" href="#{{$lang['id']}}lang"> {{$lang['language_name']}} </a>
                    </li>
                @endforeach
              </ul>
        </div>

        <div class="panel-body">
            @foreach ($languagefinder as $item)
            <div class="tab-content clearfix">
                <div class="tab-pane active " id="#{{$item['id']}}lang">
                    <div id="exTab1" class="container" style="margin-right: 0px;margin-left: 0px;">
                    </div>
                </div>
            </div>
            @endforeach
        </div>

Please sign in or create an account to participate in this conversation.