Forum Moderators: open

Message Too Old, No Replies

Add options problemn

can't add from another window

         

wolfacci

4:18 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



HI...

I'm in window 1, and I open a new window and atribute that the second window.opener is window 1;

in window 2 i'm trying to insert new options into a <select tag> but, I'm having problemns...

var obj = window.opener.document.getElementById('CD_INSTITUICAO');

var elOptNew = document.createElement('option');
elOptNew.text = 'Insert';
elOptNew.value = 'insert';
var len = obj.length;
try {
obj.add(elOptNew, len); // standards compliant; doesn't work in IE
}
catch(ex) {
obj.add(elOptNew, obj.length); // IE only
}

don't work...

wolfacci

4:27 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



SOLVED....
var elOptNew = window.opener.document.createElement('option');