Last active
May 8, 2017 04:29
-
-
Save ckschmieder/201f80a0788c9c47b59fab4982e3a492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$("#NationalPhotoMonth_submitButton").click(function(event) { | |
if (!$("#NationalPhotoMonth_Field_48").is(":checked")) { | |
event.stopImmediatePropagation(); | |
alert('You must agree to the Terms and Conditions!'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The stopImmediatePropagation() method prevents other listeners of the same event from being called.
When clicking on a button, execute the first event handler, and stop the rest of the event handlers from being executed.
https://www.w3schools.com/jsref/event_stopimmediatepropagation.asp