FRAMES - CHANGING

I've created a program in HTML which has five frames - one row at the top of the page, one narrow row at the bottom of the page, and a narrow column, a wide column and another narrow column between the top and bottom rows.  My main document, therefore, is a list of framesets.  Each frame displays a document which is defined in the frameset document.  My question is this:  When clicking a link in the left, narrow column, I want to display different documents in the rows and columns. Do I do this by creating a new document with  a different set of framesets? Is that the correct method or is there a more elegant way of doing this?  Thanks in anticipation ... Patricia
patriciacarmelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mayhewCommented:
If I understand your question right, there is an easier way.

What you do is name the frames and then use TARGET in your anchors.

A simple example is at http://www.mayhewnet.com/patricia.htm


Source code is as follows:


patricia.htm
============
<FRAMESET COLS="20%,*">

  <FRAME name="A" SRC="http://www.mayhewnet.com/Cell1.htm">

  <FRAME name="B" SRC="http://www.mayhewnet.com/Cell2.htm">

</FRAMESET>



Here you name your frames "A" and "B" respectively.



Cell1.htm
=========
<A HREF="http://www.microsoft.com" TARGET="B">Microsoft</a>
<br>
<A HREF="http://www.Yahoo.com" TARGET="B">Yahoo!</a>



Here, by specifying TARGET="B", you are telling it to display the web page in the frame named "B".


Let me know if that helps.
0
KennyIT Application ExecutiveCommented:
MayHew's proposal will only work if only the contents of 1 of the frames is changing. If you need to change the contents of more than 1 frame, you need to change the main page (the frameset) or have one of the frames consist of the framesets of the frames that will change.

for example, if the columns in the middle are going to change, but the top and bottom rows will not change, then have your main page consist of 3 frames (top, middle, bottom). The "middle" frame consists of three frames. When a user clicks something, you just change the middle frameset, not affecting the top and bottom.
0
patriciacarmelAuthor Commented:
As zxr250 points out, Mayhew's answer proposal will work if only the contents of 1 of the frames is changing.  My problem is that I need to change the contents of all the frames, except for one. Perhaps I wasn't clear on that point.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

patriciacarmelAuthor Commented:
To zxr250 - I need to change the contents of four out of the five frames by clicking one link in one of the frames.  If I understand your answer, the correct course then would be to create a new frameset doc targeting the new contents. Your second suggestion ",,,or have one of the frames consist of the framesets of the frames that will change" in that case would not be applicable.  

I thought the first alternative was probably the way to go but it seems to cumbersome that I wondered if there was a simpler way. I'm still new to HTML and I'm foggy about the best way to do things.  
0
KennyIT Application ExecutiveCommented:
yup...I have always found HTML to be long-winded. Very rarely is it clean and simple. I guess what you can do is only to have your main page consist of 2 frames. 1 that is a fixed page and the other that is a frameset of 4 more frames that keeps on changing.

Good Luck.
0
patriciacarmelAuthor Commented:
At least I have confirmation that I'm on the right tract. Thanks.
0
mayhewCommented:
Hi patricia,

Sorry I misunderstood your question.

If you're willing to use a tiny bit of javascript, you can do what you want quite easily.

Take a look again at http://www.mayhewnet.com/patricia.htm and tell me if that's what you want to do.

Let me know if that's what you want and I'll post the code, or you can look at the source of Cell1.htm.

You can also easily do it with links instead of buttons.

I haven't tested it on Netscape.  Let me know if that's a concern and I will make sure that it works properly.
0
DreamMasterCommented:
You can change all the frames simply by doing this:

<script language="javascript">
<!--
function changeframes()
{
  top.frame1.location.replace('newframe.html');
  top.frame2.location.replace('newframe.html');
  top.frame3.location.replace('newframe.html');
  top.frame4.location.replace('newframe.html');
}
//-->
</script>

change the frame1 - 4 with the names of Your frames....
the link is like this...

<a href="javascript:changeframes()">Link</a>

Good luck..ask me if You need more help ok?
0
patriciacarmelAuthor Commented:
Hello Mayhew - Many thanks for your interest. I've actually spent the afternoon creating new files and it's working fine except for one problem that perhaps you can help me with.

When I click the link in the left column (frame), it goes to the new target, with is a new created frameset document associated only with that link. In the new frameset doc, the contents of four of the five frames changes accordingly. However, and here is the problem, the original page (or the first frameset doc) remains open. What do I need to add to the new frameset document to make sure that the original one closes? BTW - I am using javascript, but it's script that was more or less dictated to me and I'm using it without really understanding what I'm doing.
0
patriciacarmelAuthor Commented:
Here's the first frameset doc:

<HTML>
<TITLE>NICE Documentation CD</TITLE>

<FRAMESET ROWS=140,*,25 FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="files/topNICE.htm" NAME="topframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">



<FRAMESET COLS=155,450,* FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="files/sideprod.htm" NAME="sideframe" SCROLLING="NO" FRAMEBORDER="0"MARGINHEIGHT="0" MARGINWIDTH="0">
<FRAME SRC="files/center.htm" NAME="centerframe" SCROLLING="AUTO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">

<FRAME SRC="files/right.htm" NAME="rightframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

<FRAME SRC="files/bottom.htm" NAME="bottomframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

</HTML>

Here's the new frameset doc:
<HTML>
<TITLE>NICE Documentation CD</TITLE>

<FRAMESET ROWS=140,*,25 FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="topLOG.htm" NAME="topframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">



<FRAMESET COLS=155,450,* FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="side.htm" NAME="sideframe" SCROLLING="NO" FRAMEBORDER="0"MARGINHEIGHT="0" MARGINWIDTH="0">
<FRAME SRC="centlog.htm" NAME="centerframe" SCROLLING="AUTO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">

<FRAME SRC="right.htm" NAME="rightframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

<FRAME SRC="bottom.htm" NAME="bottomframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

</HTML>

Is there a way I can put a replace command here (thanks Dreammaster for joining the discussion)?
0
mayhewCommented:
Hi patricia,

Can you post a URL?

I think I know what you're asking for, but I'd like to see it to be sure.
0
mayhewCommented:
Hi patricia,

No need for a URL.  I sent that comment before your code posted.

If I understand your question, what you want to do is include a TARGET="_top" in the link that opens the new frameset.

That will close the original frameset.

Let me know if that works for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
patriciacarmelAuthor Commented:
Here's the first frameset doc:

<HTML>
<TITLE>NICE Documentation CD</TITLE>

<FRAMESET ROWS=140,*,25 FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="files/topNICE.htm" NAME="topframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">



<FRAMESET COLS=155,450,* FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="files/sideprod.htm" NAME="sideframe" SCROLLING="NO" FRAMEBORDER="0"MARGINHEIGHT="0" MARGINWIDTH="0">
<FRAME SRC="files/center.htm" NAME="centerframe" SCROLLING="AUTO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">

<FRAME SRC="files/right.htm" NAME="rightframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

<FRAME SRC="files/bottom.htm" NAME="bottomframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

</HTML>

Here's the new frameset doc:
<HTML>
<TITLE>NICE Documentation CD</TITLE>

<FRAMESET ROWS=140,*,25 FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="topLOG.htm" NAME="topframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">



<FRAMESET COLS=155,450,* FRAMESPACING="0" BORDER="0" FRAMEBORDER="FFFFFF" NORESIZE>

<FRAME SRC="side.htm" NAME="sideframe" SCROLLING="NO" FRAMEBORDER="0"MARGINHEIGHT="0" MARGINWIDTH="0">
<FRAME SRC="centlog.htm" NAME="centerframe" SCROLLING="AUTO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">

<FRAME SRC="right.htm" NAME="rightframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

<FRAME SRC="bottom.htm" NAME="bottomframe" SCROLLING="NO" FRAMEBORDER="0" MARGINHEIGHT="0" MARGINWIDTH="0">
</FRAMESET>

</HTML>

Is there a way I can put a replace command here (thanks Dreammaster for joining the discussion)?
0
patriciacarmelAuthor Commented:
I feel very stupid - I'd forgotten to add the .htm extension to the link that opens the new frameset. It's now working fine.

Thanks everyone, mayhew, zxr250  and DreamMaster for your help. It's good to know that there are such mavens out there.
0
sureshkumarCommented:
hi

I understood your question like this i.e., whenever your clicking in frame you want to update the reamaining frames.If that is your problem I can give solution for that simply difine taragets with frame names.

further queries
suresh kumar
0
DreamMasterCommented:
Nice to of help....

guess i didn't provide the solution though....

ah well...maybe next time...
0
mayhewCommented:
Glad you got it working.  :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.