From: Jakub Vrana Date: Thu, 11 Jul 2013 23:30:31 +0000 (-0700) Subject: Disable inactive buttons X-Git-Tag: v4.0.0~134 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=166a2f67f8177aa404b369a5fbc3374dfd17f4e9;p=adminer.git Disable inactive buttons --- diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 44a2520a..8c36bee5 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -80,6 +80,13 @@ function trCheck(el) { */ function selectCount(id, count) { setHtml(id, (count === '' ? '' : '(' + count + ')')); + var inputs = document.getElementById(id).parentNode.parentNode.getElementsByTagName('input'); + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + if (input.type == 'submit') { + input.disabled = (count == '0'); + } + } } /** Check all elements matching given name