]> git.p6c8.net - jirafeau/pcanterino.git/blobdiff - lib/functions.js.php
Disable the send button instead of hiding it for forbidden extensions
[jirafeau/pcanterino.git] / lib / functions.js.php
index b178f4f96468ca88dbdfdfdab2c27d822ec17d47..656108b7cb69809a41aa34b6f800f115203d5450 100644 (file)
@@ -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;
     }
 }
 

patrick-canterino.de