473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems frame's display using java script

3 New Member
Hi,
I m designing a HTML page(index.html),here i have 2 frames,by defult both frames have index1.html and index2.html as their source .

in first frame(index.html) ,i have some redio buttons,and a submmit button.
so when I select one ption and click the submit button in the left side frame(or frame 1 or in index1.html) my right side frame should be reloded with a new html page as per the javascript method in main html page.

but insted I am getting no change in frame two,but an
Error "An error has occured in the script of this page
Line 10
Char 1
Error Object expected
Code 0
URL file://D:\Profiles\ncm863\Local Settings\Temporary Internet
Files\FrontPageTempDir\pvw14.htm

Do u want to continue anyway
yes/no

code for the above
index.html

[HTML]<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Servlet DemoServlet</title>
<script language="javascript" >
function displayNxtPage()
{
if(document.frame[0].Option[0].checked)
{

document.frame[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else if(document.frame[0].Option[1].checked)
{

document.frame[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}

else if(document.frame[0].Option[2].checked)
{

document.frame[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else if(document.frame[0].Option[3].checked)
{

document.frame[1].target="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else
{
document.frame[1].target="/D:/Profiles/ncm863/Desktop/htmltest/index5.html";

}

}
</script>

</head>
<FRAMESET cols="24%,74%">
<NOFRAMES>SORRY NO FRAME SUPPORT</NOFRAMES>
<FRAME SRC="index1.html" ID="first" scrolling="auto" name="first" marginwidth="2" marginheight="3"/>
<FRAME SRC="index2.html" ID="second" marginwidth="2" marginheight="3" scrolling="auto" name="second"/>

</FRAMESET>

</html>[/HTML]

index1.html

[HTML]<html>
<body>
<table width="97%" name="table" border="1">
<tr><td>
<form method="POST" >
<p><input type="radio" value="Error" name="Option" ></p>
<p><input type="radio" value="Debug" name="Option"></p>
<p><input type="radio" value="Warn" name="Option"></p>
<p><input type="radio" value="All" name="Option"></p>
<p><input type="button" value="Show" onClick="displayNxtPage()"></p>
</form>
</td></tr>
</table>


</body>

</html>
index3.html is a simple file to display

html>

<head>
<title>New Page 1</title>
</head>


<body>
//some containt

</body>
</html>[/HTML]

Please post code using code tags - moderator
Mar 14 '07 #1
3 2830
Logician
210 New Member
Hi,
I m designing a HTML page(index.html),here i have 2 frames,by defult both frames have index1.html and index2.html as their source .

in first frame(index.html) ,i have some redio buttons,and a submmit button.
so when I select one ption and click the submit button in the left side frame(or frame 1 or in index1.html) my right side frame should be reloded with a new html page as per the javascript method in main html page.

but insted I am getting no change in frame two,but an
Error "An error has occured in the script of this page
Line 10
Char 1
Error Object expected
Expand|Select|Wrap|Line Numbers
  1. onClick="displayNxtPage()"
should be
Expand|Select|Wrap|Line Numbers
  1. onClick="parent.displayNxtPage()"
and that function's addressing of the form elements is incorrect. Try:
Expand|Select|Wrap|Line Numbers
  1. if( window.frames[0].document.forms[0].Option[0].checked )
Mar 14 '07 #2
rajarya
3 New Member
Expand|Select|Wrap|Line Numbers
  1. onClick="displayNxtPage()"
should be
Expand|Select|Wrap|Line Numbers
  1. onClick="parent.displayNxtPage()"
and that function's addressing of the form elements is incorrect. Try:
Expand|Select|Wrap|Line Numbers
  1. if( window.frames[0].document.forms[0].Option[0].checked )
Thanks Logician...
That thing is working fine while i used Microsoft front page to design and preview that . But when I used Internetexplorer or Mozila firefox to open the same page, I am not getting any change in the second frame which I am supposed to get.

Please suggest me
modified codes are
mainpage(index.html)

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Servlet DemoServlet</title>
<script language="javascript" >
function displayNxtPage()
{
if(window.frames[0].document.forms[0].Option[0].checked )
{

document.frames[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else if(window.frames[0].document.forms[0].Option[1].checked )
{

document.frames[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}

else if(window.frames[0].document.forms[0].Option[2].checked )
{

document.frames[1].location="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else if(window.frames[0].document.forms[0].Option[0].checked )
{

document.frames[1].target="/D:/Profiles/ncm863/Desktop/htmltest/jscript.html";
}
else
{
document.frames[1].target="/D:/Profiles/ncm863/Desktop/htmltest/index5.html";

}

}
</script>

</head>
<FRAMESET cols="24%,74%">
<NOFRAMES>SORRY NO FRAME SUPPORT</NOFRAMES>
<FRAME SRC="index4.html" ID="first" scrolling="auto" name="first" marginwidth="2" marginheight="3"/>
<FRAME SRC="index5.html" ID="second" marginwidth="2" marginheight="3" scrolling="auto" name="second"/>

</FRAMESET>

</html>
Mar 15 '07 #3
Logician
210 New Member
Thanks Logician...
That thing is working fine while i used Microsoft front page to design and preview that . But when I used Internetexplorer or Mozila firefox to open the same page, I am not getting any change in the second frame which I am supposed to get.
frames is a property of window not document. Try changing all your references.
Mar 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1672
by: DL | last post by:
Hello, I am teaching a java course. When some of my students tried to run a very simple java program that displays a JFrame, it appeared that even though the program was compiled OK on all...
1
3227
by: bayouprophet | last post by:
Cant get menu script to to put linked page in the same frame. I am new to Java and I am wondering what am I doing wrong? below are my java applet file, frame.html file, and my text file and one...
2
2232
by: Chris Podmore | last post by:
This is driving me mad so any help will be much appreciated. I have an html page with 3 frames, banner, left and right. The banner frames source is an aspx page. The aspx page has two buttons,...
3
3817
by: Al Wilkerson | last post by:
Hey, I have a Web Form with a drop down list, textbox, and search button. When click the search button an SQL server database is queried fordata. Once I have the data in a dataset I use the...
11
16889
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got...
1
3585
by: Michael Yanowitz | last post by:
Hello: Below I have included a stripped down version of the GUI I am working on. It contains 2 dialog boxes - one main and one settings. It has the following problems, probably all related, that...
4
2723
by: ArrK | last post by:
I want to use a control frame to create and/or modify the content (images and text) of a display frame - all files and images are client side. . When I try to write to the display frame from the...
1
1316
by: dileep60 | last post by:
Hi friends, Here is my problem.My requirement is in the main window i have 2 frames.Bottom frame has few values with radio buttons.when i select the radio button and click on the update button a...
2
2595
by: vertozia | last post by:
Hey there, ive been having difficulty placing an image, this is my screenshot, and what ive done so far: http://img341.imageshack.us/img341/9894/gridwg2.jpg /** * ConnectFourGUI * Provide...
0
7218
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
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7478
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
5614
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,...
1
5035
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...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.