From: TehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:36:00 +0000 (+0200) Subject: Disable the send button instead of hiding it for forbidden extensions X-Git-Tag: 4.8.0~11^2~8 X-Git-Url: https://git.p6c8.net/jirafeau/pcanterino.git/commitdiff_plain/71c90eed43ddf3b42af7aef81e77e6c883706f16 Disable the send button instead of hiding it for forbidden extensions --- diff --git a/lib/functions.js.php b/lib/functions.js.php index b178f4f..656108b 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -346,6 +346,7 @@ function control_selected_file_size(max_size, error_str) // display options document.getElementById('options').style.display = 'block'; document.getElementById('send').style.display = 'block'; + document.getElementById('send').disabled = false; document.getElementById('error_pop').style.display = 'none'; document.getElementById('send').focus(); } @@ -360,7 +361,9 @@ function control_selected_file_extension(disallowed_extensions, error_str) if (disallowed_extensions.includes(f_ext)) { pop_failure(error_str); - document.getElementById('send').style.display = 'none'; + // keep the button visible but disabled so the user sees it is forbidden + document.getElementById('send').style.display = 'block'; + document.getElementById('send').disabled = true; } }