works on Mozilla doesn't work on IE window.opener.document

P

Peter

Hello all, i'm very new at javascript and I was hoping somebody could
help me out.

I have the following javascript code inside a php form:

foreach ($cm_phase_val['PHASES'] as $key => $ph){
echo <<<EOM

<script>
var defaultSelected = false;
var selected = false;
var optionName = new Option('$ph', '$ph', defaultSelected, selected)
var length = window.opener.document.$form_name.$field_name.length;
window.opener.document.$form_name.$field_name.options[$key]= optionName;
</script>

EOM;

}

basically it takes a values from column in a table and displays it on
the parent window drop down.

For some reason it only works on Mozilla. doesn't work on IE and don't
know how to debug it on IE. It doesn't have a javascript console debugger.

Can somebody give me some tips.

Thanks
Peter
 
M

Martin Honnen

Peter said:
var optionName = new Option('$ph', '$ph', defaultSelected, selected)

Try
var optionName = new window.opener.Option('$ph', '$ph',
defaultSelected, selected)
instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top