1
I wanted this to display one by one the content of my form however it displays me all at once, the right would be it display the next only after clicking send and this data I will save in an array.
Is it my logic that this wrong? could someone give me a helping hand.
Follow my test:
<?php
$totalPerguntas = 2;
$quantidadeVezes =0;
while($quantidadeVezes <= $totalPerguntas){
for ($i = 1; $i <= $totalPerguntas; $i++) {
echo '<input type="text" name="produto[1][nome]" value="nome do produto" />';
echo '<input type="text" name="produto[1][valor]" value="valor do produto" />';
echo '<input type="text" name="produto[1][codigo]" value="codigo do produto" />';
echo '<button>Enviar</button>';
}
$quantidadeVezes++;
}
?>
Hi Fernando. Can you explain better how the code that runs in the browser should "talk" to PHP and generate content? are you using ajax or want it to happen when the page loads?
– Sergio
Hi Pablo, I would like it to only be displayed one by one, and only the next form to be displayed after the click of the button, however it is displaying everything at once and it was only to show 2 forms
– Fernando