PDA

View Full Version : IE5.0 iframe updating a parent select box problem


Darksbane
03-06-2003, 06:10 PM
Hi,

I am currently using an IFrame to load options to a select box in the parent page, unfortunately in IE5.0 it gives an error when the script tries to load the select box.

I am currently using:

parent.document.FormName.SelectboxName.options[i] = new Option(xxx,xxx);

to update from the iframe. This works in IE5.5+, NS6.2+, and Mozilla. Is there something different about refrencing the parent document in IE5.0?

Any suggestions would be appreciated.

Thanks,

Darksbane

Darksbane
03-07-2003, 12:06 AM
anyone have any ideas?

GoHF
03-07-2003, 03:11 AM
opt = new Option(xxx,xxx);
parent.document.FormName.SelectboxName.add(opt);

This is DOM1, so it should work with IE4+ and every other IFrame compatible browsers. Hope it helps.

A link that might (or not) help:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/add.asp