It does work in IE 6 as I've used it successfully, innerHTML is also good,
but you probably know that one.
Cheers
Martin
----- Original Message -----
From: "kujo" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Wednesday, November 21, 2007 10:25 AM
Subject: Re: FN-FORUM: IE inner.HTML workaround?
>
> If I remember right IE cannot handle getElementById straight away, at
> least IE6 did not, but I might be wrong.
> This would fix that:
>
> if(document.all &&!document.getElementById) {
> document.getElementById = function(id) {
> return document.all[id];
> }
> }
>
> Or you can still use prototype or mootools, in that case
>
> document.getElementByID("mysel") will become $('mysel')
>
>
>
> Juraj Seffer wrote:
>> On 20 Nov 2007 22:36:19 -0000, Martin Wilkins [EMAIL REMOVED]
>> wrote:
>>
>>> Dont u need to be chaning/creating the options value rather than the
>>> innerhtml - otherwise when the form is submitted is value will be null??
>>>
>>> Please, if I'm wrong anyone, shout up!
>>>
>>> Cheers
>>> Martin
>>> p.s. wots with the crazy text face??
>>> ----- Original Message -----
>>> From: "Juraj Seffer" [EMAIL REMOVED]
>>> To: [EMAIL REMOVED]
>>> Sent: Tuesday, November 20, 2007 8:00 PM
>>> Subject: FN-FORUM: IE inner.HTML workaround?
>>>
>>>
>>>
>>>> Hi all,
>>>>
>>>> What is the best solution to work around bug in Internet Explorer
>>>> preventing you to amend inner.HTML?
>>>> I have AJAX which replaces elements inside , it works
>>>> fine in FF, Opera and Safari but IE fails.
>>>>
>>>> Is the below the best way?
>>>>
>>>> var opt = document.createElement("option");
>>>> opt.innerHTML = "text of the option";
>>>> opt.value = "0″;
>>>> document.getElementByID("mysel").appendChild(opt);
>>>>
>>>> Thanks
>>>> Jay
>>>> --
>>>>
>>
>> Top posting pff :)) I used to be like that also.
>>
>> I just tried to submit that form which uses innerHTML to replace
>> select options via Firefox, worked fine so it didn't send empty (null)
>> select.
>>
>> It's just that annoying IE which needs to be fixed.
>>
>> Re crazy text face - not sure what you meant but no harm done.
>>
>> Thanks
>> Jay
>>
>
> --
> Freelancers, contractors earn more with Prosperity4
> Call 0870 870 4414 or visit www.prosperity4.com
> and benefit from Inland Revenue approved expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>