 |
| Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 13th, 2003, 06:00 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Works with IE5 and IE6, but not NS
Hi all,
The code below works with IE but not NS. When the Start button is clicked nothing happens...however it works fine with IE.
Any thoughts?
Thanks,
Vincent
First the Frame defintion source code:
<frameset name="ExamFrames" rows="23%,77%" BORDER=0 framespacing=0 frameborder=0 scrolling=no noresize>
<frame name="topFrame" src="/ExamCabinet/Exam1.html" >
<frame name="bottomFrame" src="/ExamCabinet/Exam2.php3" >
</frameset>
Now the the form source code:
Sample code 1
<FORM NAME="QForm">
<DIV ID="divn">
<INPUT type="button"
value=" Start the EXAM "
onClick="window.top.frames(1).getNext()">
</div>
</form>
Sample code 2
<FORM NAME="QForm">
<DIV ID="divn">
<INPUT type="button"
value=" Start the EXAM "
onClick="top.bottomFrame.getNext()">
</div>
</form>
|
|

August 13th, 2003, 08:28 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Netscape (and IE as well) expect [ and ] as array indexers:
IE also supports (), but I guess Netscape sees that as parentheses for a method call.
onclick="window.top.frames[1].getNext()
should work.
HtH
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 13th, 2003, 09:20 AM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Imar,
I have cleaned up the brackets/parenthesis as you suggested. However, it still does not work with Netscape.
Anymore thoughts???
Regards,
Vincent
Change
<form NAME="QForm">
<div ID="divn">
<input type="button"
value=" Start the EXAM "
onClick="window.top.frames[1].getNext()">
</div>
</form>
|
|

August 13th, 2003, 10:02 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Unfortunately I can't test / recreate the situation here right now (I am a bit in a hurry), but here are a few things to test / try:
1. Make sure the getNext method is present in JavaScript in frame[1]. (Duh, it probably is.....)
2. Try to use the framename instead of an index, like frames["topFrame"]
3. Try to use top.frames["frameName"] instead of window.top.frames
If this doesn't help, post some more code and I can try to figure it out ....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 13th, 2003, 12:14 PM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi all,
Frames GURU...where are you???
I have tried everything and it just does not work!!! I am searching the web for some examples...unsuccessfully at this point.
I just want to see NETSCAPE successfully:
onClick... call a function in a different frame.
Regards,
Vincent
Hoe gaat het?
|
|

August 13th, 2003, 04:19 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Vincent,
Alles gaat goed hier. Beetje warm.... ;)
I guess you must be overlooking something. Here is a small solution that should work well. It comprises of 3 pages: the frameset, top and bottom page.:
Frameset.html
Code:
<html>
<head>
<title>Frameset</title>
</head>
<frameset rows="26%,*">
<frame name="frmTop" src="top.html" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
<frame name="frmBottom" src="bottom.html" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0">
</frameset>
</html>
top.html
Code:
<html>
<head>
<title>Top</title>
<script language="JavaScript">
function TestMe()
{
alert('Top');
}
</script>
</head>
<body>
top.html
</body>
</html>
bottom.html
Code:
<html>
<head>
<title>Bottom</title>
</head>
<body>
bottom.html
<form>
<input type="button" onclick="top.frames['frmTop'].TestMe();" value="Click">
</form>
</body>
</html>
Simply copy and paste it to three files and run it. It should work in all versions of Netscape.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 14th, 2003, 05:42 PM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Imar,
Sorry, for replying so late. I have been working on the bug feverishly and hoped to be able to say it is all working good...but
Your code was perfect and it helped me narrow my problem, in fact I was getting into the function but there are other problems.
I will like to explain further when I have sorted it out completely.
Once again, your help was really appreciated.
Thanks or Bedankt,
Vincent
p.s., I am Vincent with 2 ears, I don't want to cut mine.
|
|

August 14th, 2003, 05:54 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Graag gedaan ;)
Imar
Quote:
quote:Thanks or Bedankt,
Vincent
|
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

August 14th, 2003, 06:18 PM
|
|
Registered User
|
|
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Heeeey Imar,
Damn I'm good...
I just found my bug!!!
The div id was lowercase in the Head document.getElementById
and
Uppercase in the Body in the actual div tag.
It worked in IE but NS got lost. I made them both the same and presto...I love NS now.
Once again Thanks,
Vincent
laat je gaan, laat je nemen, nuken en de keuken... I used to be able to speak goed Nederlaands, at least at house parties, but I forgot everything.
<script language="JavaScript">
function refreshTopicArea(topicArea, xCnt, padding, yCnt) {
refreshTopicArea function');
document.getElementById("divp").innerHTML =
(' ') +
.
.
.
<body bgcolor="#ffffff" text="#000000" link="#0000ff">
<form NAME="QQForm">
<div ID="DIVP">
<h1>
<img src="Images/sap-logo.gif" height=23>
|
|
 |