durrrr
01-14-2009, 10:23 AM
Hi
I am trying to increment an array with a new id value everytime the criteria within my for loop and if statement is met. is my syntax for the array correct? i think the value in the array is being overwritten everytime the loop goes around? any help is most appreciated!
thanks alot
code:
var idStr;
var idArr = new Array ("1","2","3","4","5");
var checkedArray = new Array();
for (i = 0; i < idArr.length; i++) {
idStr = idArr[i];
if (document.getElementById(idStr) != null && document.getElementById(idStr).checked == true){
checkedArray = idStr;
}
}
thanks alot
I am trying to increment an array with a new id value everytime the criteria within my for loop and if statement is met. is my syntax for the array correct? i think the value in the array is being overwritten everytime the loop goes around? any help is most appreciated!
thanks alot
code:
var idStr;
var idArr = new Array ("1","2","3","4","5");
var checkedArray = new Array();
for (i = 0; i < idArr.length; i++) {
idStr = idArr[i];
if (document.getElementById(idStr) != null && document.getElementById(idStr).checked == true){
checkedArray = idStr;
}
}
thanks alot