I am trying to put a form inside a form, here is my code:
<form action="info.php" method="post" id="test1">
<input type="hidden" name="name" value="test">
<a id="test" style="text-decoration:none;" onclick="document.getElementById('test1').submit();">
<!-- somestuff -->
<form action="insertCart.inc.php" method="POST" id="test11">
<p class="card button"><button type="button" onclick="document.getElementById('test11').submit();" name="add-to-cart">Add to Cart</button></p>
</form>
</div>
</a>
</form>
I have tried lots of javascript with the onclick but if i click on the button that is inside the from that is inside the from it will do nothing, but if i change the type to submit it will submit the from with the id "test1" that is also not what i want. Is there any way i can fix it??