web/search.{js, php}: pass the event to the submit handler
PATCH 1/1 web/search.{js, php}: pass the event to the submit handler
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).
--- web/search.js | 2 +- web/search.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
web/search.js +1 -1
@@ -1,4 +1,4 @@ -function submitForm() { +function submitForm(event) { // Do not send the form event.preventDefault();
web/search.php +1 -1
@@ -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">
Signature · 1 line
2.21.0
PATCH 1/1 web/search.{js, php}: pass the event to the submit handler
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Victor" == Victor Huesca <[email protected]> writes:
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).
Signed-off-by Victor Huesca <[email protected]>
Thanks!
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 web/search.{js, php}: pass the event to the submit handler
In reply to Victor HuescaQuoted 5 lines · On Mon, 26 Aug 2019 14:14:05 +0200 Victor Huesca <[email protected]>…
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).
Quoted 7 lines
Signed-off-by Victor Huesca <[email protected]>--- web/search.js | 2 +- web/search.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied to buildroot-test, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com