Results 1 to 4 of 4

Thread: form validation

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    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

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  3. #3

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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 !

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140

    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
  •  



Click Here to Expand Forum to Full Width