Reply to Re: Two Frames, one action, update both, How??

Your name:

Reply:


Posted by Erwin Moller on 10/13/06 09:47

steve wrote:

> Hi All,
> My site has two frames, one with a menu system, one with the
> selected results.
> I can select a menu item and get the other frame to reflect that
> selection.
>
> But I want to select 'log out' from the menu and remove the menu sytem
> as well as putting a default welcome page in to 2nd frame.
>
> Any ideas will be gratefully received
>
> New to PHP, and HTML
>
> Steve

Hi STeve,

You are probably new to JavaScript then also. :-)
You need Javascript to update more frames at once.
That eans that visitors with JavaScript disabled will not be able to use
your site.
You might consider a setup without frames.

If you want to solve it with JavaScript, try something like this:
[for more question try cop.lang.javascript]

The framedefinition:
2 frames, name them, eg "navframe" and "mainframe"
navframe contains a file named nav.php
mainframe contains any file.

If somebody clicks on 'logout' in nav.php:
<a href="" onClick="doLogOut();return false;">logout</a>

<script type="text/javascript">
function doLogOut(){
// replace two pages in a frame:
top.frames["mainframe"].location="welcome.php";
top.frames["navframe"].location="whatever.php";
}
</script>

not tested, might contain typos. ;-)
Good luck.

Regards,
Erwin Moller

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация