In the code below, “clicked” is logged out, but “submitted” is never logged. Anyone know why? The IDs are correct.
$('#submitModal').click(function(){
console.log("clicked");
$('#createEvent').submit(function() {
console.log('submitted');
return false;
});
});
This code binds a handler. It doesn’t trigger one.
You’d need to bind it first, then trigger it when needed.
Also you may have some issues if
$('#submitModal')is a submit button to aformelement. Not sure.