|
-
Dec 28th, 2001, 08:08 AM
#1
Thread Starter
Evil Genius
form validation
is there a way I can loop through all controls on a page please ?
I.e. on a form submit, the code loops through 5 textboxes to check if any are blank (like with vb) - is this possible with javascript please ?
Thanks All
-
Dec 28th, 2001, 10:07 AM
#2
Frenzied Member
I think there is a getElementsByTag function, or something like that, in the DOM. It should return an NodeArray of all of the "input" Nodes.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 28th, 2001, 10:10 AM
#3
Thread Starter
Evil Genius
Cheers both of you, Travis, do you know if that one's for NutScrape as well as IE before I start using it ?
Cheers again !
-
Dec 28th, 2001, 10:38 AM
#4
Frenzied Member
getElementsByTagName()
Sorry, it is DOM 3, which is still in Working Draft I think.
As to Netscape/Mozilla, they have vowed 100% compliance with no proprietary extensions. I would expect it to work when it is part of the recommendations. It is possible it works now, but it is not garunteed.
Now, if you have a page that "works" in IE but will not work in Netscape, then it is very likely that your page is using MS propreitary extensions.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
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
|