5
I need to create and remove dynamically div´s
for a form I have, already made using table, but now I was asked div´s
.
I tried to make an adaptation but I couldn’t, what I need is to create a button to insert the div´s
and one to remove them if necessary.
My full form is:
<section>
<div class="container">
<div class="container">
<div class="row">
<header class="text-center margin-top-20">
<h4 align="center">Preencha os campos para gerar a impressão do termo</h4>
</header>
<br>
<header class="text-center margin-top-20">
<h4 align="center">Informações Autorizador</h4>
</header>
<br>
<div class="col-sm-1"></div>
<div class="col-sm-10">
<form id="frmCadastro" class="sky-form clearfix" action="" method="post" target="_blank">
<div class="row">
<div class="col-md-4 col-sm-4">
<input type="text" name="NomeAutorizador" id="NomeAutorizador" value="" class="form-control required" tabindex="2" placeholder="Nome">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="NacAutorizador" id="NacAutorizador" value="" class="form-control required" tabindex="2" placeholder="Nacionalidade">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="ProfAutorizador" id="ProfAutorizador" value="" class="form-control required" tabindex="2" placeholder="Profisssão">
<i class="fancy-arrow"></i>
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6">
<input type="text" name="CPFAutorizador" id="CPFAutorizador" value="" class="form-control required" tabindex="2" placeholder="CPF">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-6 col-sm-6">
<input type="text" name="RGAutorizador" id="RGAutorizador" value="" class="form-control required" tabindex="2" placeholder="RG">
<i class="fancy-arrow"></i>
</div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6">
<input type="text" name="EndAutorizador" id="EndAutorizador" value="" class="form-control required" tabindex="2" placeholder="Endereço">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="CidadeAutorizador" id="CidadeAutorizador" value="" class="form-control required" tabindex="2" placeholder="Cidade">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-2 col-sm-2">
<input type="text" name="UFAutorizador" id="UFAutorizador" value="" class="form-control required" tabindex="2" placeholder="UF">
<i class="fancy-arrow"></i>
</div>
</div>
<header class="text-center margin-top-20">
<h4 align="center">Informações Autorizado</h4>
</header>
<br/>
// ESSA ROW QUE PRECISO INSERIR
<div class="row">
<div class="col-md-4 col-sm-4">
<input type="text" name="NomeAutorizado" id="NomeAutorizado" value="" class="form-control required" tabindex="2" placeholder="Nome">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="CPFAutorizado" id="CPFAutorizado" value="" class="form-control required" tabindex="2" placeholder="CPF">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="RGAutorizado" id="RGAutorizado" value="" class="form-control required" tabindex="2" placeholder="RG">
<i class="fancy-arrow"></i>
</div>
</div>
<div class="row">
<div class="col-md-4 col-sm-4">
<input type="text" name="BancoAutorizado" id="BancoAutorizado" value="" class="form-control required" tabindex="2" placeholder="Banco">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="AgenciaAutorizado" id="AgenciaAutorizado" value="" class="form-control required" tabindex="2" placeholder="Agência">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="CCAutorizado" id="CCAutorizado" value="" class="form-control required" tabindex="2" placeholder="Conta Corrente">
<i class="fancy-arrow"></i>
</div>
</div>
// ESSA ROW QUE PRECISO INSERIR**
<header class="text-center margin-top-20">
<h4 align="center">Local</h4>
</header>
<br/>
<div class="row">
<div class="form-group">
<div class="col-md-12 col-sm-12">
<select name="Unicoop" class="form-control pointer required" id="Unicoop">
<option value="0">Unicoop</option>
<?php foreach ($ResUnicoop as $Unicoop) { ?>
<option value="<?php echo $Unicoop->IdUnicoop ?>"><?php echo $Unicoop->Nome ?></option>
<?php } ?>
</select>
<i class="fancy-arrow"></i>
</div>
</div>
</div>
</form>
<div class="row">
<div class="col-md-12">
<button class="btn btn-primary pull-right btn-block">IMPRIMIR</button>
</div>
</div>
<div id="msgBusca" style="padding: 10px;">
<!-- Mensagens -->
</div>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</div>
</section>
I have several rows
in this form, but the one that I need to insert the most is this one:
<div class="row">
<div class="col-md-4 col-sm-4">
<input type="text" name="BancoAutorizado" id="BancoAutorizado" value="" class="form-control required" tabindex="2" placeholder="Banco">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="AgenciaAutorizado" id="AgenciaAutorizado" value="" class="form-control required" tabindex="2" placeholder="Agência">
<i class="fancy-arrow"></i>
</div>
<div class="col-md-4 col-sm-4">
<input type="text" name="CCAutorizado" id="CCAutorizado" value="" class="form-control required" tabindex="2" placeholder="Conta Corrente">
<i class="fancy-arrow"></i>
</div>
</div>
My form has this ID:
<form id="frmCadastro" class="sky-form clearfix" action="" method="post" target="_blank">
I’m not gonna post what I tried to do 'cause I honestly can’t use it.
I was watching this video class yesterday, I hope it helps you: https://www.youtube.com/watch?v=UKKR0sEMGE8&list=PLcHPNq67CaVnHwfOeK9-7n57aOV6orMSO
– Laércio Lopes