Shambler
11-25-2003, 03:36 AM
Hi
Ok, I have a lot of forms that need to be reset when pressing a button.
I currently have a resetForms()-function containing something like this:
document.checkform1.reset();document.checkform2.reset(); ........
With quite a lot of forms, this yells for a forloop.. how would I do this without using the document.write-function? I would like to do something like this:
var maxNumberOfForms = 42;
var i;
for(i=0; i<maxNumberOfForms; i++) {
"document.checkform"+i+".reset()";
}
(I know this syntax is erroneous, but pseudo-wise this is what I would like it to do)
As far as I'm concerned the document.write() (or document.writeln())-functions write a new file with the specified text? Or?
Thanks in advance :)
Ok, I have a lot of forms that need to be reset when pressing a button.
I currently have a resetForms()-function containing something like this:
document.checkform1.reset();document.checkform2.reset(); ........
With quite a lot of forms, this yells for a forloop.. how would I do this without using the document.write-function? I would like to do something like this:
var maxNumberOfForms = 42;
var i;
for(i=0; i<maxNumberOfForms; i++) {
"document.checkform"+i+".reset()";
}
(I know this syntax is erroneous, but pseudo-wise this is what I would like it to do)
As far as I'm concerned the document.write() (or document.writeln())-functions write a new file with the specified text? Or?
Thanks in advance :)