From 2c2412267b009c0f9ab21f3e3e570593cdaa0fe1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 3 Jul 2008 23:17:55 +0000 Subject: [PATCH] Merged revisions 57390 via svnmerge from svn://svn.silverstripe.com/silverstripe/modules/cms/branches/2.2.2-caron ........ r57390 | ischommer | 2008-07-04 11:06:25 +1200 (Fri, 04 Jul 2008) | 1 line BUGFIX Preventing non-ajax form submit in CMSMain when pressing enter-key inside certain form fields in Firefox - overloaded onsubmit to use CMSForm->save() now ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@57388 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain_right.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/javascript/LeftAndMain_right.js b/javascript/LeftAndMain_right.js index 9ab5a532..fe2954a9 100755 --- a/javascript/LeftAndMain_right.js +++ b/javascript/LeftAndMain_right.js @@ -7,6 +7,17 @@ CMSForm.prototype = { this.prepareForm(); }, + /** + * Trigger normal save event, helpful e.g. when enter key is pressed in + * single line input fields. + */ + onsubmit: function(e) { + this.save(); + + Event.stop(e); + return false; + }, + /** * Processing called whenever a page is loaded in the right - including the initial one */