I am attempting to use the buttons selector $(":button") along with the id selector for a specific button $("#btnGo") and am running into a bit of an issue. The idea is that the click action should work for all the buttons on the page EXCEPT the specific one, which will have it's own button click event defined. What happens is that both click event handlers get called.
How do I go about doing this such that my btnGo's event handler gets called and the all buttons click action does not when I click on the btnGo button?
Thank you!
-
$(function() {
$( "#btnGo" )
.button()
.click(function( event ) {
alert(this.id);
return true;
});
$( ":button" )
.button()
.click(function(event){
alert(this.id);
setElementAndSubmitForm( document.forms[0], '_eventId', this.id );
return true;
});
});