1) Is there anyway that I can do something like
onclick= #remove a specific div class/disable the button for the div class#
using javascript(open to other suggestions and I don’t really know about any other options).
Example:
<div class="well" id = 73909><b>This is what i'm trying to do</b>
<br><form name="Cart" method="post" action="/Cart.cfm">
<input class="btn btn-primary" id="73909-button"
onclick="remove this.div"
type="submit" value="ADD TO CART">
</form>
</div>
2) Related
is there anyway for me check the response I get from submitting the form(after the button click) and only perform the task in question (1) if it meets certain criteria?
Yes to both, you can use javascript to remove a class from an element as well as disable a button. Here is an example with jquery:
There are many validation libraries out there, jquery validation being one, that you can use to validate a form for certain criteria. HTML5 also has many of these built into the form fields as attributes HTML5 Validation Examples
[UPDATE]
If you want to remove it for everybody, you will need to have each client poll, or use websockets to push, the data for constant updates. If you are using polling, you will need some validation that the cart item still exists to be removed as it could have been removed by someone else seconds earlier. Depending on your load, and what you are trying to do, this sounds like a good candidate for websockets.