[thelist] [DOM] Dynamically adding an OPTION to SELECT - funky IE vs Gecko...

Tom Dell'Aringa pixelmech at yahoo.com
Tue Mar 16 06:45:35 CST 2004


--- Andrew Clover <and-evolt at doxdesk.com> wrote:
>... but it's probably a better idea to use> the 
> Select object's tried-and-true 'options' collection, or the normal
> Level 1 Core method appendChild to populate the field instead.

Thanks all who suggested that, I will do that. I had not for some
reason thought of that. FWIW my workaround was a try catch :P

try 
{
   newSelect.add(option)
}
catch(e) { /* do nothing */ }

try 
{
   newSelect.add(option, null)
}
catch(e) { /* do nothing */ }

While quite ugly, it did work! But NOT the way I want to do things :)

Tom

=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.DMXzone.com/ - JavaScript Author
http://SparklesParties.com - Princess parties for little girls!
http://www.thywordistruth.net/ - Eternal Life

"Well, my name's Dewey Oxburger. My friends call me Ox. I dont know if you've noticed, but I got a slight weight problem."





More information about the thelist mailing list