0
I have a registration form and there’s a link (already has account) executing another form (login), this being a modal. My problem is that when trying to submit/submit the modal form (login), it requires that the fields of the normal form (registration) that was open be filled in, because this registration form requires some mandatory fields. How to proceed?
php registration form.
<div class="container">
<div class="row espacamento">
<div class="col-md-8 col-md-offset-2">
<form role="form" method="POST" action="confirmacao.php">
<fieldset>
<div class="form-group col-md-12">
<legend>Cadastro</legend>
</div>
<div class="form-group col-md-12">
<label for="first_name">Nome completo
</label>
<input type="text" class="form-control" name="nome" id="name" placeholder="Nome completo" required>
</div>
<div class="form-group col-md-6">
<label for="first_name">Data de Nascimento
</label>
<div class='input-group date'>
<input type='text' name ="datanasc" id="datanasc" class="form-control datanasc"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group col-md-12">
<label for="first_name">Endereço
</label>
<input type="text" class="form-control" name="endereco" id="endereco" placeholder="Endereço" required>
</div>
<div class="form-group col-md-6">
<label>Cidade</label>
<input type="text" class="form-control" name="cidade" placeholder="">
</div>
<div class="form-group col-md-6">
<label for="country">UF</label>
<select class="form-control" name="estado" id="country">
<option value="estado">Selecione o Estado</option>
<option value="Acre">Acre</option>
<option value="Alagoas">Alagoas</option>
<option value="Amazonas">Amazonas</option>
<option value="Amapá">Amapá</option>
<option value="Bahia">Bahia</option>
<option value="Ceará">Ceará</option>
<option value="Distrito Federal">Distrito Federal</option>
<option value="Espírito Santo">Espírito Santo</option>
<option value="Goiás">Goiás</option>
<option value="Maranhão">Maranhão</option>
<option value="Mato Grosso">Mato Grosso</option>
<option value="Mato Grosso do Sul">Mato Grosso do Sul</option>
<option value="Minas Gerais">Minas Gerais</option>
<option value="Pará">Pará</option>
<option value="Paraíba">Paraíba</option>
<option value="Paraná">Paraná"</option>
<option value="Pernambuco">Pernambuco</option>
<option value="Piauí">Piauí</option>
<option value="Rio de Janeiro">Rio de Janeiro</option>
<option value="Rio Grande do Norte">Rio Grande do Norte</option>
<option value="Rondônia">Rondônia</option>
<option value="Rio Grande do Sul">Rio Grande do Sul</option>
<option value="Roraima">Roraima</option>
<option value="Santa Catarina">Santa Catarina</option>
<option value="Sergipe">Sergipe</option>
<option value="São Paulo">São Paulo</option>
<option value="Tocantins">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label>Email</label>
<input type="email" class="form-control" name="email" placeholder="E-mail" required>
</div>
<div class="form-group col-md-6">
<label>Telefone</label>
<input type="tel" class="form-control telefone" id="telefone" name="tel" maxlength="15" autocomplete="off" onkeyup="mascara2(this, mtel2);" required>
</div>
<div class="form-group col-md-6">
<label for="password">Senha</label>
<input type="password" class="form-control" name="senha" id="password" placeholder="Senha" required>
</div>
<div class="form-group col-md-6">
<label for="password">Confirme a senha</label>
<input type="password" class="form-control" name="repetesenha" id="repetir_senha" placeholder="Confirme sua Senha..."
oninput="validaSenha(this)" required>
</div>
</fieldset>
<!--CHAMANDO O MODAL-->
<div class="form-group">
<div class="col-md-12">
<button type="submit" name="enviar" class="btn corbotao">Cadastrar</button>
<?php include 'login-conta.php';?>
</div>
</div>
</form>
</div>
</div>
</div>
login-account.php (modal)
<div class="modal fade" id="modal-mensagem">
<div class="modal-dialog">
<div class="modal-content espacamento">
<div class="modal-header">
<button type="button" class="close glyphicon glyphicon-remove" data-dismiss="modal"></button>
<h4 class="modal-title">Acesso</h4>
</div>
<div class="modal-body">
<form name="fomrlogin" role="form" method="POST" action="confirm-login.php">
<fieldset>
<div class="form-group col-md-8">
<label>E-mail</label>
<input type="email" class="form-control" name="email" placeholder="E-mail" required>
</div>
<div class="form-group col-md-6">
<label for="password">Senha</label>
<input type="password" class="form-control" name="senha" id="password" placeholder="Senha" required>
</div>
</fieldset>
<div class="form-group">
<div class="col-md-12">
<button type="submit" name="login" class="btn corbotao">Entrar</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<a data-toggle="modal" data-target="#modal-mensagem" href="">Já possui uma conta?</a>
First, edit the question by accessing the [Edit] link and insert the HTML code. Use the button
{}
from the editor to properly format the code. It is preferable even to do a [mcve] and in this case you can use the snippet of the site through the button</>
of the editor.– Woss
Anderson thanks for the tip. View now after edit.
– Raimundo Alves
login-account.php is my moldal. It is a screen to access the system. Nothing is loaded inside it, only the codes of the moldal. It is called by clicking "already have an account"
– Raimundo Alves
You are loading the login form into the registration form and this is not possible. See more on I have one form inside the other and I can’t get the most internal form. That is, the forms are not separate.
– Woss
Thank you Anderson, so, concluding, it is not possible the Moldal on the registration form.
– Raimundo Alves
Yeah, you just do the
include
out of of the registration form. It can be directly within thediv.container
.– Woss
Thanks. I changed the include location and it worked. Thanks.
– Raimundo Alves