Created
June 8, 2009 19:14
-
-
Save joshuaclayton/126005 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
$("form").each(function(idx, form) { | |
var onsubmit = $(form).attr("onsubmit"); | |
if(typeof(onsubmit) !== undefined) { | |
$(form).removeAttr("onsubmit"); // this properly removes the attribute; nothing within this is triggered | |
$(form).submit(function() { | |
alert("submitted!"); // this doesn't get called | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment