In My project I have three forms being one independent of the other. The form1, form2 e form3
. The form1
contains mandatory fields to be filled, and that data will be necessary to generate the information of the other two forms
.
So follow my problem, how can I check to see if form1
was filled in at the time I submit it for form2 ou form3
?
I was able to handle this with PHP
, by the time it arrives on the page PHP
I make a isset
on POST
to see if form1
data came too, but I need this work done on the side of the client.
<form class="form-horizontal" id="FormInfObg" action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
<input type="text" class="form-control" name="nome" placeholder='<?php if(isset($_POST['nome'])){$_SESSION['nome']=$_POST["nome"];echo $_SESSION['nome'];}else{ echo "Nome Completo";}?>'>
<input type="text" class="form-control" name="cargo" placeholder='<?php if(isset($_POST['cargo'])){$_SESSION['cargo']=$_POST["cargo"];echo $_SESSION['cargo'];}else{ echo "Cargo";}?>'>
<button class="btn btn-default" name="btnSalvar" value="btnSalvar">Salvar <span class="fa fa-floppy-o"></span></button>
</form>
<form class="form-horizontal" id="Form2" action="proc.php" method="POST">
<input type="text" class="form-control" name="filial">
<button class="btn btn-default" type="submit" value="btnSubmitForm2">Enviar</button>
</form>
<form class="form-horizontal" id="Form3" action="proc.php" method="POST">
<input type="text" class="form-control" name="nSerial">
<button class="btn btn-default" type="submit" value="btnSubmitForm3">Enviar</button>
</form>