Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH buildroot-test] web/search.{js, php}: pass the event to the submit handler
@ 2019-08-26 12:14 Victor Huesca
  2019-08-27 20:14 ` Peter Korsgaard
  2019-09-25 20:55 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Victor Huesca @ 2019-08-26 12:14 UTC (permalink / raw)
  To: buildroot

Some web-browsers do not define the global event object on functions
callback (see [1]). This cause an 'undefined event' error on the search
page. Passing the event argument from the function caller fix this (at
least it does on Firefox ESR 60.0.8).

[1] http://buildroot-busybox.2317881.n4.nabble.com/New-search-features-on-autobuild-buildroot-org-tt230624.html

Signed-off-by: Victor Huesca <victor.huesca@bootlin.com>
---
 web/search.js  | 2 +-
 web/search.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/search.js b/web/search.js
index cf52478..d624ade 100644
--- a/web/search.js
+++ b/web/search.js
@@ -1,4 +1,4 @@
-function submitForm() {
+function submitForm(event) {
     // Do not send the form
     event.preventDefault();
 
diff --git a/web/search.php b/web/search.php
index bcdd62e..821308f 100644
--- a/web/search.php
+++ b/web/search.php
@@ -7,7 +7,7 @@ bab_header("Buildroot tests - Search page");
 <script type='text/javascript' src="search.js"></script>
 
 
-<form action="index.php" method="get" onsubmit="submitForm()">
+<form action="index.php" method="get" onsubmit="submitForm(event)">
     <label>
         <span>Submitter:</span>
         <input type="text" name="submitter" placeholder="Submitter">
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-25 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-26 12:14 [Buildroot] [PATCH buildroot-test] web/search.{js, php}: pass the event to the submit handler Victor Huesca
2019-08-27 20:14 ` Peter Korsgaard
2019-09-25 20:55 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox