Forum Moderators: open
document.forms[0]
document.forms[1]
...
or
document.forms["formName"]
Do i name the form using id="formname" or name="formname"?
I tried both, and neither way works for me. The only way i am able to reference the form is with document.forms[0]
which isn't a really big deal.. but it would be nice to figure out what i'm doing wrong.
function loop(){
for (var i = 0; i <= 48; i++) {
var arg = "document.forms["+i+"]";
calculate(arg);
}
}
In the other thread i have going, i end up with a problem with this loop function. Like i said: document.forms[0] works fine... but when i use the loop function to send this argument to the calculate function, i get an error. When i send the argument directly to calculate(arg) from the submit button, the script runs smoothly. There is some issue with the loop function.