[thelist] Javascript/Dropdown box detection

Tom Dell'Aringa pixelmech at yahoo.com
Wed Sep 10 08:02:28 CDT 2003


--- Jeff Howden <jeff at jeffhowden.com> wrote:

> actually, the method being used is shorthand for dom 0.  each form
> field becomes a "property" of the form object...

Right, I understand that. What I should have said is that I prefer
using the brackets for clarity.
 
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > First I would set my drop as a variable.
> >
> >    var myDrop = document.forms['multi'].elements['acct[]'];
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> 
> except that a reference to the form is being passed as "form" so
> the above reference should be shortened:

Right...I was just trying to be thorough in my explanation :)

> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > Secondly, your reference to the text is slightly off:
> >
> >    if(myDrop[myDrop.selectedIndex].text == "")..
> >
> > You do not refer to the options when you are grabbing
> > the text.
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> 
> on one hand you say to use the elements array, but on another you
> say to not use the options array?  make up your mind.  ;p

Yeah... good point. You could use it here too.

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author / JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward


More information about the thelist mailing list