I have several forms, being 1 in each tab of the bootstrap, however whenever I submit only the values of tab0 form are sent, I would like to know how to resolve to send the active form. In each form has a submit, being that I have already changed the names and id of the forms and also of the submit and yet it did not work. It works by sending the whole form per post, but it does not work using ajax!
index.php
<h1>Incluir Processo</h1>
<ul class="nav nav-tabs">
<li><a href="#processo" data-toggle="tab" >Processo </a></li>
<li><a href="#sinistro" data-toggle="tab">Sinistro </a></li>
<li><a href="#beneficiario" data-toggle="tab">Beneficiario </a></li>
<li><a href="#observacoes" data-toggle="tab">Observacoes</a></li>
<li><a href="#documentos" data-toggle="tab">Documentos</a></li>
<li><a href="#anexos" data-toggle="tab">Anexos</a></li>
<li><a href="#historico" data-toggle="tab">Historico</a></li>
<li><a href="#pagamentos" data-toggle="tab">Pagamentos</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane active in" id="processo">
<?php include_once("includes/formularios-incluir/form-incluir-processo.php"); ?>
</div>
<div class="tab-pane fade" id="sinistro">
<?php include_once("includes/formularios-incluir/form-incluir-sinistro.php"); ?>
</div>
include-process.php
<h2>Processo</h2>
<div class="container-fluid">
<div class="row">
<form action="javascript:void%200" onSubmit="enviaDados('././comandos.php?acao=salvaProcesso'); return false" name="formprocesso" id="formprocesso">
<div class="form-group">
<div class="col-md-4 col-sm-6 col-xs-6">
<label for="dtsinistro" class="margin-top-label">Data do Sinistro</label>
<input type="text" name="dtsinistro" class="form-control" id="datepicker" placeholder="00/00/0000" autofocus required/>
</div>
<div class="col-md-6 col-xs-12 btn-right">
<button type="submit" name="enviaprocesso" id="enviaprocesso" class="btn btn-success"><i class="fa fa-floppy-o"></i>Gravar</button>
<button type="reset" name="reset" class="btn btn-default"><i class="fa fa-trash"></i>Apagar</button>
<button name="btn-cancela" id="btn-cancela" data-dismiss="modal" class="btn btn-primary"><i class="fa fa-times"></i>Cancelar</button>
</div>
</div>
</form>
</div>
</div>
include-sinistro.php
<h2>Sinistro</h2>
<div class="container-fluid">
<div class="row">
<form action="javascript:void%200" onSubmit="enviaDados('././comandos.php?acao=salvaSinistro'); return false" id="formsinistro" name="formsinistro">
<div class="form-group">
<div class="col-md-3 col-sm-6 col-xs-12">
<label for="numero" class="margin-top-label">Número do Sinistro</label>
<input type="text" name="numero" class="form-control" autofocus required id="numero"/>
</div>
<div class="col-md-9 col-sm-10 col-xs-12 btn-right">
<button type="submit" name="enviasinistro" id="enviasinistro" class="btn btn-success" onclick = "document.formsinistro.submit()"><i class="fa fa-floppy-o"></i>Gravar</button>
<button type="reset" name="reset" class="btn btn-default"><i class="fa fa-trash"></i>Apagar</button>
<button name="btn-cancela" id="btn-cancela" data-dismiss="modal" class="btn btn-primary"><i class="fa fa-times"></i>Cancelar</button>
</div>
</div>
</form>
</div>
</div>
I put some of the codes of 2 files that I submit and try to save in a bank, but the sinister does not send the data, the process data that is the form of the first tab is always sent.