maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] JS Bugfixing


From: Pierre Mauduit
Subject: [Maposmatic-dev] [PATCH] JS Bugfixing
Date: Tue, 22 Dec 2009 12:42:45 +0100

From: Pierre Mauduit <address@hidden>

There was a regression when I switched keypress to keyup event.
The keypress event was responsible of unexpected form submission.
To avoid this, we have to catch the keypress event as well.
---
 www/templates/maposmatic/index.html |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/www/templates/maposmatic/index.html 
b/www/templates/maposmatic/index.html
index 15e1ab1..0f544b8 100644
--- a/www/templates/maposmatic/index.html
+++ b/www/templates/maposmatic/index.html
@@ -59,6 +59,19 @@ function pageinit()
                                            return false;
                                          }
                                        });
+
+  /* the keypress event is responsible of posting our form. We need to
+   * catch this too in order to avoid submission. (issue encountered
+   * with Chrome browser)
+   */
+
+  $('#id_administrative_city').keypress(function (e)
+                                       {
+                                         if (e.which == 13)
+                                         {
+                                           return false;
+                                         }
+                                       });
 }
 
 
-- 
1.6.5.7





reply via email to

[Prev in Thread] Current Thread [Next in Thread]