I'm new to Bootstrap and I have a doubt. It is possible to put tabpanels within a form so I could divide the fields of the form in multiple tabpanels, use dynamic tabs and submit the form as just one form? As an example I have the code below.
<div class="content-wrapper">
<section class="content">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation"><a href="#aba1" role="tab" data-toggle="tab">Dados Pessoais</a></li>
<li role="presentation"><a href="#aba2" role="tab" data-toggle="tab">Dados Médicos</a></li>
</ul>
<div class="tab-content">
<form role="form">
<!-- text input -->
<div role="tabpanel" class="tab-pane active" id="aba1">
<div class="box-header with-border">
<h3 class="box-title col-md-12">Dados Pessoais</h3>
</div>
<!-- /.box-header -->
<div class="form-row">
<div class="form-group col-md-6">
<label>Nome do Paciente</label>
<input type="text" class="form-control" placeholder="Nome" required="true">
</div>
<div class="form-group col-md-3">
<label>CPF</label>
<input type="number" class="form-control" placeholder="CPF">
</div>
<div class="form-group col-md-3">
<label>RG</label>
<input type="number" class="form-control" placeholder="RG">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label>Data de Nascimento</label>
<input type="date" class="form-control" placeholder="Data de Nascimento">
</div>
<div class="form-group col-md-2">
<label>Sexo</label>
<select class="form-control">
<option>Masculino</option>
<option>Feminino</option>
</select>
</div>
<div class="form-group col-md-2">
<label>Estado Civil</label>
<select class="form-control">
<option>Solteiro(a)</option>
<option>Casado(a)</option>
<option>Divorciado(a)</option>
<option>Viúvo(a)</option>
</select>
</div>
<div class="form-group col-md-6">
<label>Nome do Cônjuge</label>
<input type="text" class="form-control" placeholder="Nome do Cônjuge">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label>Endereço</label>
<input type="text" class="form-control" placeholder="Endereço">
</div>
<div class="form-group col-md-3">
<label>Bairro</label>
<input type="text" class="form-control" placeholder="Bairro">
</div>
<div class="form-group col-md-3">
<label>Cidade</label>
<input type="text" class="form-control" placeholder="Cidade">
</div>
<div class="form-group col-md-2">
<label>CEP</label>
<input type="text" class="form-control" placeholder="CEP">
</div>
</div>
</div>
<!-- /.tabpanel 1 -->
<div role="tabpanel" class="tab-pane" id="aba2">
<div class="box-header with-border">
<h3 class="box-title col-md-12">Dados Médicos</h3>
</div>
<!-- /.box-header -->
<div class="form-row">
<div class="form-group col-md-6">
<label>Nome do Paciente</label>
<input type="text" class="form-control" placeholder="Nome">
</div>
<div class="form-group col-md-3">
<label>CPF</label>
<input type="number" class="form-control" placeholder="CPF">
</div>
<div class="form-group col-md-3">
<label>RG</label>
<input type="number" class="form-control" placeholder="RG">
</div>
</div>
</div>
<!-- /.tabpanel 2 -->
<div class="row">
<!-- left column -->
<div class="col">
<!-- general form elements -->
<div class="box box-warning">
<div class="form-row">
<div class="btn-group-left" role="group">
<button type="button" class="btn btn-primary">Anterior</button>
<button type="button" class="btn btn-primary">Próximo</button>
</div>
<div class="btn-group-right" role="group">
<button type="button" class="btn btn-danger">Cancelar</button>
<button type="submit" class="btn btn-success">Cadastrar</button>
<input type="button" class="btn btn-success" value="Cadastrar">
</div>
</div>
</div>
</div>
<!--/.box box-warning -->
</div>
<!--/.col -->
</div>
<!--/.row -->
</form>
</div>
<!--/.tab-content -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
I want to have two tabpanels, so I can use the dynamic tabs, but I need to submit all fields as one form. It is possible? I've searched around about this subject and i've read a few guys saying that different forms can be send as just one if you serialize them with jQuery. It is a valid alternative in this case?
PS: I'm also new here in Stackoverflow, so if there's any mistake in the way I have made my question, please tell me so I can correct it. And the names of the fields are in Portuguese, because I'm Brazillian and I'm trying to make an application that will serve as a test. If the names difficult the comprehension, let me know, so I can translate it.
You should be able to do this with JavaScript:
<input type="button" value="Click Me!" onclick="submitForms()" />
If your forms have IDs:
submitForms = function(){
document.getElementById("form1").submit();
document.getElementById("form2").submit();
}