schmazz
11-13-2004, 12:09 AM
Hello,
I am working on a loop that counts my elements. When I debug, I get the error "e.elements[i] has no properties" (line 10).
I have defined i as a variable with value of 0, and a form passes to e. So, I have both i and e defined as something... What's my problem? I don't understand how neither of them has properties. (Or which one, for that matter, doesn't have properties).
function countElements(e){
var rb=0
var b=0
var tb=0
var cb=0
var i=0
var totalNum=e.elements.length
for(i=0;i<=totalNum;i++){
if (e.elements[i].type=="text")tb=tb+1;
else if (e.elements[i].type=="button")b=b+1;
else if (e.elements[i].type=="radio")rb=rb+1;
else if (e.elements[i].type=="checkbox")cb=cb+1
}
Thanks again,
Kristina
I am working on a loop that counts my elements. When I debug, I get the error "e.elements[i] has no properties" (line 10).
I have defined i as a variable with value of 0, and a form passes to e. So, I have both i and e defined as something... What's my problem? I don't understand how neither of them has properties. (Or which one, for that matter, doesn't have properties).
function countElements(e){
var rb=0
var b=0
var tb=0
var cb=0
var i=0
var totalNum=e.elements.length
for(i=0;i<=totalNum;i++){
if (e.elements[i].type=="text")tb=tb+1;
else if (e.elements[i].type=="button")b=b+1;
else if (e.elements[i].type=="radio")rb=rb+1;
else if (e.elements[i].type=="checkbox")cb=cb+1
}
Thanks again,
Kristina