Are you just looking for fields with the name "test" ? You could use document.getElementsByName
When you mean all "fields" in a form, are you talking about input fields? How many "fields" are there in your form if it takes such a long time to loop through them all?
Something like this might work if they are inputs:
Main Topics
Browse All Topics





by: MorcalavinPosted on 2008-08-28 at 07:27:12ID: 22335239
Using item[index] shouldn't be illegal. It's only of the many ways you can reference your objects/collections, which are stored with key->value pairs. The below code worked for me in all browsers I tested, assuming your form had an id of 'myform'.
As far as "for(i in ...){...}". This iterates over all the keys(properties, methods, etc) in a particular object, in this case, the "elements" object/collection.
Select allOpen in new window