1
I have a form where the user type what equipment he wants to consult and
AFTERWARD to click confirm, I need the fields with the information appear. These fields are in another PHP file that will make the selects based on the data selected in the form. Using Hidden doesn’t meet my needs
<form method="post" action="test.php">
<label style="margin-top: 5px;">
<span style="margin-right: 18px;">Equipamento:</span>
<input type="text" name="equipamento" id="equipamento" size="12" style="margin-top: 5px;" autofocus required>
</label>
<input style="margin-left: 20px;" type="submit" name="submit" value="Confirmar">
</form>
<br>
<div> <?php require_once("test.php"); ?> </div>
Data must appear inside the DIV above.
You can use Ajax and make the request for this php file. After return you populate your div with the information you need.
– bio
Can you tell me how to do this?
– Luigi Azevedo
I think I understand your idea, but the logic for your need may be better... instead of you inputar via include a file after the action in the form, you can just make an innerHtml() or an append, and use these methods (javascript) to insert code fragments and sequence their logic. For this, Voce uses the serialize to send the form via ajax and in return vc checks if it was ok your Submit and loads the return.
– Michel Simões