Created
January 15, 2014 03:22
-
-
Save lnickers2004/8430206 to your computer and use it in GitHub Desktop.
BOOTSTRAP3: HANDLING MODAL DIALOG EVENTS
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() | |
{ | |
//get a referenct to the dialog | |
var $sentDialog = $("#sentDialog"); | |
debugger; | |
//register handler for the form's submittal | |
$("#contactForm").on("submit", function () { | |
debugger; | |
//show the modal dialog | |
$sentDialog.modal('show'); | |
return false; //don't actually submit the form | |
}); | |
//register some boostrap on handlers | |
$sentDialog.on("hidden.bs.modal", function () { | |
//do some work, save form, move onto another page etc | |
alert("hidden bs modal"); | |
}); | |
$sentDialog.on("focusin.bs.modal", function () { | |
//do some work, save form, move onto another page etc | |
alert("focus in bs modal"); | |
}); | |
$sentDialog.on("keyup.dismiss.bs.modal", function () { | |
//do some work, save form, move onto another page etc | |
alert("keyup.dismiss.bs.modal"); | |
}); | |
$sentDialog.on("click.dismiss.modal", function () { | |
//do some work, save form, move onto another page etc | |
alert("clicked dismiss modal"); | |
}); | |
$sentDialog.on("show.bs.modal", function () { | |
//do some work, save form, move onto another page etc | |
alert("show boostrap modal"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment