|
-
Mar 5th, 2002, 01:41 PM
#1
Thread Starter
Addicted Member
All elements in a form?
I'm looking for a Javascript that can go through all the elements (checkboxes, textboxes, etc) in a form of mine onLoad and test to see if their value equals something, then do an action. Does anybody know a way of doing it? I have seen some form validation that use the onSubmit="functionName(this)" in the form tag but that doesn't seem to work with an onload.
-
Mar 5th, 2002, 02:46 PM
#2
is the form being loaded from a database?
-
Mar 5th, 2002, 04:16 PM
#3
Fanatic Member
Is it something like this you are looking for?
http://getelementbyid.com/scripts/lo...ge/index.shtml
It counts all the items on the page and displays a loading message until its loaded.
-
Mar 6th, 2002, 06:46 AM
#4
Thread Starter
Addicted Member
Thanks for the replies but I figured it out with trial and error
Here's what I came up with (there are 55 checkboxes I'm working with).
for (x=0; x<56; x++)
{
if (document.forms[0].elements[x].value == '<? echo($loadName); ?>')
{
doSomeStuff(now);
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|