This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
In IE, the add() method for the select element doesn't follow the W3C rules. You may need to tinker with the parameters that you pass to it to get it to work.
What is the specific error that you are getting, and what exactly are you trying to do?
You mean IE6 doesn't support Select.add()? But I do get such a function in ie6 by:
And HTMLSelectElement interface of DOM Level2 does define such a method. I get the type mismatch problem when using such a method rather than exception related to undefined method.
Originally posted by Alec Lee: You mean IE6 doesn't support Select.add()?
Yes, it does. But it's weird about how it interprets the 2nd parameter.
For example, if you are trying to add the option to the end of the list, the W3C Specification states that you should pass null. But IE6 requires a zero. Stuff like that.
Alec Lee
Ranch Hand
Joined: Jan 28, 2004
Posts: 568
posted
0
Thanks,
I am looking for a way to insert a new option at the START of the option list. It seems that if I want to directly modify the options[] array, I can only append an element at the end of it by 'options[options.length]=new Option(..)' or overwrite another option by 'options[0]=sth'. This codes result in typeerror exception:
BTW, where can I find the microsoft's spec on its select.add() method?