Created
April 29, 2011 14:47
-
-
Save christopherhein/948405 to your computer and use it in GitHub Desktop.
This file contains 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($){ | |
$.fn.confirm = function(params){ | |
if($(this).length){ | |
elem = $(this); | |
open = false; | |
elem.submit(function() { | |
valid = $(".global-form.confirm").valid(); | |
if(valid == true) { | |
if(open == false) { | |
open = true; | |
$('#confirm-overlay').fadeIn( function() { | |
$('#confirm-overlay #confirm-message .buttons a#cancel').bind('click', function() { $('#confirm-overlay').fadeOut(function() {open = false;}); return false; }); | |
$('#confirm-overlay #confirm-message .buttons a#submit').bind('click', function() { $('.confirm').submit(); return false; }); | |
}); | |
return false; | |
} else { | |
return true; | |
} | |
} else { | |
return false; | |
} | |
}); | |
} | |
} | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment