From: Michael J. Rubinsky Date: Thu, 15 Apr 2010 21:11:04 +0000 (-0400) Subject: Hitting enter while in the location field shouldn't submit the form. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0e5e23b0cbb441cfdf414a5a8f2abde48468a39e;p=horde.git Hitting enter while in the location field shouldn't submit the form. Catch KEY_RETURN in the keydownHandler, and trigger the geocode action if we are in the location field of the event form. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index bc0c36a48..1ed244e70 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3261,7 +3261,14 @@ KronolithCore = { keydownHandler: function(e) { var kc = e.keyCode || e.charCode, - form = e.findElement('FORM'); + form = e.findElement('FORM'), trigger = e.findElement(); + + if (trigger.id == 'kronolithEventLocation' && kc == Event.KEY_RETURN) { + this.ensureMap(); + this.geocode($F('kronolithEventLocation')); + e.stop(); + return; + } if (form) { switch (kc) {