Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > works on Mozilla doesn't work on IE window.opener.document

Reply
Thread Tools

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

 
 
Peter
Guest
Posts: n/a
 
      06-13-2006
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.leng th;
window.opener.document.$form_name.$field_name.opti ons[$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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      06-13-2006


Peter wrote:

> var optionName = new Option('$ph', '$ph', defaultSelected, selected)


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



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Peter
Guest
Posts: n/a
 
      06-13-2006
Martin Honnen wrote:
>
>
> Peter wrote:
>
>> var optionName = new Option('$ph', '$ph', defaultSelected, selected)

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

yes

thank you. it works

Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
With IE works fine. But With Mozilla it won't work C#_learner Javascript 3 06-26-2006 02:31 PM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
script works in hta files and also mozilla but not work on IE? lendle Javascript 1 09-21-2004 03:12 AM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM
mozilla 1.5 from mozilla 1.4 Disco Firefox 6 11-07-2003 04:34 PM



Advertisments