input names with '-' in their names.

Giganews Newsgroups
Subject: input names with '-' in their names.
Posted by:  Sandman (…@sandman.net)
Date: Wed, 03 Sep 2003

I have a input like this:
    <select name="born-year">
        [list of years]
    </select>

And I want to set this input to the first in selectedIndex, which usually is
done by

    document.form.input.selectedIndex = 0

But this won't work:

    document.form.born-year.selectedIndex = 0

Probably because it has a '-' in it's name, right? How do I do it?

--
Sandman[.net]

Replies