From e739e3e8df1bc076221a2ad227e41a3c88a26506 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Wed, 13 Feb 2019 00:33:27 -0600 Subject: Improve javascript and enable the Check All logic. Delete button is disabled. Check All is selected and all checkboxes are checked and Delete button enables. Check All is deselected, and checkboxes are unchecked. Check All selected, all check boxes enabled, one checkbox disabled, check all unchecked. --- A8_srv_build/list.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'A8_srv_build') diff --git a/A8_srv_build/list.php b/A8_srv_build/list.php index 4714382..c5c3b47 100644 --- a/A8_srv_build/list.php +++ b/A8_srv_build/list.php @@ -239,15 +239,22 @@ if ($stmt->rowCount() > 0) { +checkBoxes.change(); + +$("#selectall").click(function () { + $(".checks").prop('checked', $(this).prop('checked')); + $('#submit').prop('disabled', checkBoxes.filter(':checked').length < 1); +}); + +$(".checks").change(function(){ + if (!$(this).prop("checked")){ + $("#selectall").prop("checked",false); + } +}); + -- cgit v1.2.3-54-g00ecf