I'm trying to repeat a certain loop again when a button is clicked i tought about using Javascript but i do not know how I would add something to a php variable
Here is my code:
<?php
$productAmount = 0;
for($i = 0;$i <= $productAmount; $i++)
{
?>
<tr>
<td>
<b>Amount:</b><input name='amount' type='text' required>
</td>
<td>
<b>Product:</b><input name='product' type='text' required>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan='2'>
<button type='button' class='add-btn' id='add-btn'>Check</button>
</td>
</tr>
So what i'm trying to do is add 1 to $productAmount when the button is clicked. But in real time so you immediatly see a result. I do not necessarily need specific code(it is appreciated tough) but a little nudge to the right direction is already a huge help.
</div>