I have a table with two rows and each one has button . I want the second button pops up a modal but when I run my code the window modal that is supposed to pop up by me clicking on the "View Cart" button doesn't pop up . instead it's already there when I change my page to the page where i have the "View Cart" button. Can anyone help me to solve this problem?
<table>
<tr>
<div class="btn_form" style="length :150px;">
<form method="post" action="single.php">
<input type="image" name="cart" value=<?php echo $array[0]['ProductID']?>image src="img/cart.png height="100px" width="100px" onClick="document.submitForm.hidbrand.value=this.value; document.submitForm.submit();" />
</form>
</div>
</tr>
<tr>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">View Cart</button>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</tr>
</table>