TAP5-1859: Clicking a submit or button in a non-Tapestry Form causes a client exception
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/d6ec62cf Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/d6ec62cf Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/d6ec62cf Branch: refs/heads/5.3 Commit: d6ec62cfb3fb14385f667facf9f7ae5fb86685e8 Parents: 4fbe60b Author: Howard M. Lewis Ship <hls...@apache.org> Authored: Fri Aug 17 17:45:49 2012 -0700 Committer: Howard M. Lewis Ship <hls...@apache.org> Committed: Fri Aug 17 17:45:49 2012 -0700 ---------------------------------------------------------------------- .../resources/org/apache/tapestry5/tapestry.js | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6ec62cf/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js b/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js index 26d151a..08f8053 100644 --- a/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js +++ b/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js @@ -749,8 +749,12 @@ Element * (a Submit or LinkSubmit) */ setSubmittingElement: function (form, element) { - form.getFormEventManager() - .setSubmittingElement(element); + + // A crude check to see if it is a Tapestry form. + + if ($(form).getInputs("hidden", "t:formdata").size() > 0) { + form.getFormEventManager() .setSubmittingElement(element); + } }, /**