I have a button on my webpage with the code below -
HTML:
<button type="submit" class="checkout-button" id="checkout-button" name="checkout-button"></button>
CSS
.checkout-button{
width: 130px;
height: 35px;
background: url('../poc2/images/checkout.png') no-repeat;
border: none;
vertical-align: top;
margin-left:35px;
cursor:pointer;
}
Now the button works fine, as I can click on it and execute my corresponding PHP code; the pointer turns into a hand symbol, allowing the user to clearly know that he is available for a click and that his button.
What I would like to do is change the behavior of this button based on some conditions. Pseudo-code example:
if flag=1:
else:
How do I encode this on-off logic for a button? Basically, I want the button to work like a button in normal situations; and just like an image without any hyperlink in some other situations.
source
share