英文:
Create Tab panel as submit event
问题
<div class="panel panel-primary tabs-style-2">
<div class="tab-menu-heading">
<div class="tabs-menu1">
<!-- Tabs -->
<ul class="nav panel-tabs main-nav-line" >
<li><a href="{{ route('admin.productionData.index') }}" class="nav-link {{ $no_production_tab ? '' : 'active' }}" data-toggle="tab" >Production</a></li>
<li><a href="javascript:void(0);" onclick="submitForm()" class="nav-link {{ $no_production_tab ? 'active' : '' }}" >No Production</a></li>
</ul>
</div>
</div>
</div>
在 "No Production" 选项卡中,我已将链接更改为使用 JavaScript 调用 submitForm()
函数,您可以在此函数中执行 POST 请求以避免在地址栏中显示 URL。
英文:
<div class="panel panel-primary tabs-style-2">
<div class="tab-menu-heading">
<div class="tabs-menu1">
<!-- Tabs -->
<ul class="nav panel-tabs main-nav-line" >
<li><a href="{{ route('admin.productionData.index') }}" class="nav-link {{ $no_production_tab ? '' : 'active' }}" data-toggle="tab" >Production</a></li>
<li><a href="?no_production_tab=1" class="nav-link {{ $no_production_tab ? 'active' : '' }}" data-toggle="tab" >No Production</a></li>
</ul>
</div>
</div>
</div>
here is my code, its working fine but rather then get method i want use with post method for No Production tab
temp i had added method with href but want to work as post method so url will not display in address bar.
答案1
得分: 0
英文:
<a href="?no_production_tab=1" onclick="event.preventDefault(); document.getElementById('form-to-submit').submit();">
No production
</a>
<form id="form-to-submit" action="?no_production_tab=1" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
You can use the link like this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论