From 96c0bf55119b21f0448b528ac5d9b2b6688b678c Mon Sep 17 00:00:00 2001 From: ninadsp Date: Mon, 7 Jun 2010 02:13:58 +0530 Subject: [PATCH] Refactored the setCheckboxes code with jQuery --- js/functions.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/functions.js b/js/functions.js index 1779dd193..0ce6c72ff 100755 --- a/js/functions.js +++ b/js/functions.js @@ -1202,12 +1202,12 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultClass1, theD * @return boolean always true */ function setCheckboxes( container_id, state ) { - var checkboxes = document.getElementById(container_id).getElementsByTagName('input'); - for ( var i = 0; i < checkboxes.length; i++ ) { - if ( checkboxes[i].type == 'checkbox' ) { - checkboxes[i].checked = state; - } + if(state) { + $("#"+container_id).find("input:checkbox").attr('checked', 'checked'); + } + else { + $("#"+container_id).find("input:checkbox").removeAttr('checked'); } return true;