Results 1 to 3 of 3

Thread: Stupid question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Okay, if I'm not mistaken, all input elements with the same name, will become an array in the DOM.

    In other words...

    Code:
    <html>
      <body>
        <form name='myForm'>
          <input name='myInput'>
          <input name='myInput'>
        </form>
        <script language='JavaScript'>
          function myFunc() {
            alert document.myForm.myInput[0].value;
            alert document.myForm.myInput[1].value;
          }
        </script>
      </body>
    </html>
    I could be wrong.
    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.

  2. #2
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212
    You're probably not, since I have successfully used this tactic with radio buttons.

    So i guessed i'll try again with this method. I thought I was wrong coz I was gettin' an error as chkNotifier didn't exist... If you see any mistake in my code, don't hesitate to tell me !

    Thanks for the input !
    Regards,

    El-Nino

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Lose the parenthesis next to the name. The DOM enumerates them not you.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

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