473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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
Jun 13 '06 #1
2 3555


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/
Jun 13 '06 #2
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
Jun 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Moon | last post by:
Seems I still haven't got the hang of all those window generating code in Javascript. I've got a page with about 15 photo thumbnails. When you click on a thumbnail a new window pops up which shows...
1
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
4
by: Iver Erling Årva | last post by:
I have an application that uses a window.open() to open it's own main window where all my programs takes place. I use a timeout so if nothing goes on for 15 minutes the document below is called. To...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
5
by: Derek Erb | last post by:
I am banging my head against the wall with this one. The following code snippets work perfectly fine in MSIE6. But produce an error in Firefox and do not work at all. BROWSER.HTM <HTML> .......
3
tpgames
by: tpgames | last post by:
2x2 Sudoku doesn't work at all. The images don't show up on the grid. I don't understand JavaScript very well. Just learning it. Thanks! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
1
by: jerkyjerk | last post by:
Ei guys..newbie in programming..just want to ask how will I compare the contents of particular cell of the table(from parent window) to the contents of a cell of the table (child window)? how will I...
1
by: sarath chandran | last post by:
Hi Iam trying to make my application work in Mozilla. The below piece of code works well in IE but throws error in Mozilla. Can you modify the below piece of code so that it supports IE and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.