diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php
index d81a3a71..b21ae673 100644
--- a/adminer/include/adminer.inc.php
+++ b/adminer/include/adminer.inc.php
@@ -125,7 +125,7 @@ class Adminer {
echo adminer()->loginFormField('driver', '
' . lang('System') . ' | ', html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);"));
echo adminer()->loginFormField('server', ' |
---|
' . lang('Server') . ' | ', '');
// this is matched by compile.php
- echo adminer()->loginFormField('username', ' |
---|
' . lang('Username') . ' | ', '' . script("qs('#username').form['auth[driver]'].onchange();"));
+ echo adminer()->loginFormField('username', ' |
---|
' . lang('Username') . ' | ', '' . script("const authDriver = qs('#username').form['auth[driver]']; authDriver && authDriver.onchange();"));
echo adminer()->loginFormField('password', ' |
---|
' . lang('Password') . ' | ', '');
echo adminer()->loginFormField('db', ' |
---|
' . lang('Database') . ' | ', '');
echo "\n";
diff --git a/compile.php b/compile.php
index 8948c247..53c2ac38 100755
--- a/compile.php
+++ b/compile.php
@@ -316,7 +316,7 @@ if ($vendor) {
if (!$count) {
echo "auth[driver] form field not found\n";
}
- $file = str_replace(" . script(\"qs('#username').form['auth[driver]'].onchange();\")", "", $file);
+ $file = str_replace(" . script(\"const authDriver = qs('#username').form['auth[driver]']; authDriver && authDriver.onchange();\")", "", $file);
if ($vendor == "sqlite") {
$file = str_replace(");\n\t\techo \$this->loginFormField('server', ' |
---|
' . lang('Server') . ' | ', ' |
---|