|
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
Navigation:
[Reply to this message]
|