Skip to content Skip to sidebar Skip to footer

Jquery Not Registering Button Click

I have a page that displays a list of products. The user can select the quantity of a product to order and then click the order button. This should place a reference to the quantit

Solution 1:

Don't use ID on button. You have to use class if you want to assign event to multiply objects.

When you are using id selector jQuery assign event only to first object becouse ID sholud be unique.

Change:

$("#orderBtn").click(function(event){
..
}

To:

$(".orderBtn").click(function(event){
..
}

And HTML declaration:

<inputtype="submit" value="Add to Order"id="orderBtn"/>

To:

<inputtype="submit" value="Add to Order"class="orderBtn"/>

Post a Comment for "Jquery Not Registering Button Click"