[QUOTE=FatBaldGuy]
In this case, I don’t want the users to link directly to pages in the main frame. Think of something like a home banking application, where the user enters a login/password to get to the main page, then has options on the left side to show balances, history, loan payments, etc.
I can figure out how to make it work using standard anchor tags ( <a href=… >), but I wanted to use buttons instead of text links.
Are there any php techniques that would make this easier?
[/QUOTE]
The technique doesn’t change if you use an input button. You just reference the frame in the input onlick call like this:
<input type=“button” value=“Clickme to open in another frame” onclick=“mainframe.location.href=‘option1.htm’”>
Or, if you want to generalize the function in Javascript, you can write a function like this:
function loadFrame(frameName, pageName)
{
var targetFrame;
targetFrame = document.getElementById(frameName);
targetFrame.location.href=pageName;
}
Then your input statement can look like this:
<input type=“button” value=“clickme” onclick=“loadFrame(‘mainframe’,‘option1.html’)” />
This assumes you have a frame where the ID is set to “mainframe”
If you have access to php, you can do server-side stuff. In which case I’d once again recommend ditching the frames and use server-side includes to build your page on the server and send it as one html document. Use CSS to position the elements on the page. This separates the client from the server logic, allows you to write different versions of the page for different browser technologies, and makes the whole thing far more maintainable going forward.