Matt.Swaggi
03-07-2012, 08:28 PM
When i did a view source , checkbox names are displayed as MedicalAction_listOfTransfers_[0]__rowSelected'
so each checkbox has different name and id as well
all i am trying to do here is to put a checkall/uncheckall option , also in the jsp page we have a pagination
so is that something that cause the checkbox value as null ?
function MoveAll(){
var lengthofRecords = document.getElementById('resultsSize').value;
for (i = 0; i < lengthofRecords; i++){
var name = 'MedicalAction_listOfTransfers_'+i+'__rowSelected';
var checkBox = document.getElementById(name);
alert("check box B4: " + checkBox); - // I AM GETTING NULL VALUE HERE
checkBox.checked=checkBox.checked == false ? true:false;
alert("check box A4: " + checkBox.checked);
//checkBox.checked = checkBox.checked? true:false;
}
}
Please help i am newbie :mad:
so each checkbox has different name and id as well
all i am trying to do here is to put a checkall/uncheckall option , also in the jsp page we have a pagination
so is that something that cause the checkbox value as null ?
function MoveAll(){
var lengthofRecords = document.getElementById('resultsSize').value;
for (i = 0; i < lengthofRecords; i++){
var name = 'MedicalAction_listOfTransfers_'+i+'__rowSelected';
var checkBox = document.getElementById(name);
alert("check box B4: " + checkBox); - // I AM GETTING NULL VALUE HERE
checkBox.checked=checkBox.checked == false ? true:false;
alert("check box A4: " + checkBox.checked);
//checkBox.checked = checkBox.checked? true:false;
}
}
Please help i am newbie :mad: