i have an issue with my form which contain a tab, each tab contain a form inputs, the problem is when i click 'submit' it post even values from other tabs that are not active.
code HTML in the ASPX Page :
<section class="content-wrapper main-content clear-fix">
<form id="form1" method="post" runat="server">
<input id="Submit" type="submit" onclick="noPostBack('AfficherRapport.aspx')" name="Filtrer" value="Filtrer"/>
<asp:HiddenField ID="position" Value='$("ul.tabs li.active").index()' runat="server"/>
<nav>
<ul runat="server" id="myTab" class="tabs">
<li class="active">
<a href="#tab1">enseign_site</a>
</li>
<li class="">
<a href="#tab2">iwaHadaMakan</a>
</li>
</ul>
</nav>
<!-- Tab panels -->
<div runat="server" id="myRapports" class="tabContainer">
<div id="tab1" class="tabContent" style="display: block;">
<input type="text" name="STAMP1" placeholder="STAMP1"/>
</div>
<div id="tab2" class="tabContent" style="display: none;">
<input type="text" name="STAMP1" placeholder="STAMP1"/>
</div>
</div>
</form>
</section>
code Tab Jquery :
$(document).ready(function () {
//hiding tab content except first one
$(".tabContent").not(":first").hide();
// adding Active class to first selected tab and show
$("ul.tabs li:first").addClass("active").show();
// Click event on tab
$("ul.tabs li").click(function () {
// Removing class of Active tab
$("ul.tabs li.active").removeClass("active");
// Adding Active class to Clicked tab
$(this).addClass("active");
// hiding all the tab contents
$(".tabContent").hide();
// showing the clicked tab's content using fading effect
$($('a', this).attr("href")).fadeIn('slow');
return false;
});
});
**/!** : Tabs are fulfilled in the class behid of the view if you need some extra informations, you just ask for it. Thanks a lot