After customizing a button with CSS the decoration is applied properly but the button becomes inactive, I cannot click on it and it won't submit.
Here is the code:
.addToCart {
width: 100px;
border-radius: 4px/4px;
border: 2px #E8CD00;
height:20px;
text-align: center;
vertical-align: center;
font-family: "Trebuchet MS", sans-serif;
font-size: 13px;
font-weight: bold;
padding: 1px;
background-color: #E8CD00;
color: black;
}
<form name="cartAdding">
<input type="hidden" name="productid" />
<input type="hidden" name="command" />
</form>
<input type="submit" value="ADD TO CART" class="addToCart" onclick="addtocart(<?php $itemId?>)" />
You need to move the input into the form element.
<form name="cartAdding">
<input type="hidden" name="productid" />
<input type="hidden" name="command" />
<input type="submit" value="ADD TO CART" class="addToCart" onclick="addtocart(<?= $itemId ?>)" />
</form>
Put the button inside the
<form>
tags. Also keep in mind that clicking the button will submit the form, and unless your Javascript function returns false, you may see unexpected activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With