3
In My project I have three formularies being one independent of the other. The form1, form2 e form3. The form1 are mandatory fields to be filled in, and these data will be necessary to generate the information of the other two forms.
So follow my problem, how can I check whether the form1 was filled in at the time I do the Submit by form2 ou form3?
I managed to treat it with PHP, when you arrive on the page PHP I make a isset in the POST to see if the data from form1 came also, only that I need this work to be carried out on the client’s side.
<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>
From what you’re saying, you need to do the
POSTofFORMsviaAjax, but to present the best way you need to post the content of your page in the question...– Kenny Rafael
All right, see if it helps.
– lkzvieira
The first
formneed to be saved before or only filled and will save at once?– Kenny Rafael
It needs to be saved first. In order to avoid the situation of the user
submitof the other twoformswithout having completed theform1– lkzvieira