I have nav-tabs for my page and for each nav-tab contents I have a Next button.
Check my image below
When you click next button the form will be save and go to next tab but the problem is the page will refresh so the result is the tab will go back to the first one. How can I fix this problem??
Here's my code below
my Javascript for Next tab functions
$('.btnNext').click(function(){
$('.nav-tabs > .active').next('li').find('a').trigger('click');
});
My ajax for submit
function( data ) {
if(data.success == true)
{
$('#property-submition').addClass("confirmed");
$('#property-submition').submit();
}
else if(data.exists == true)
{
// check if same property exists in database
$('#ajax-indicator-1').hide();
$('#property-submition').removeClass("confirmed");
// Show message that this property already exists
alert("<?php _l("Property already exists"); ?>");
}........
My submit form Code
<?php echo form_open(NULL, array('class' => 'form-horizontal form-estate', 'role'=>'form', 'id'=>'property-submition'))?>
........
.....
...
..
<?php echo form_submit('', lang('Next'), 'a class="btn btn-primary btnNext"')?>