Question concerning JavaScript, I know its php board

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Question concerning JavaScript, I know its php board

Post by nigma »

Hey, I know this is a PHP board but I figure that you guys all have some exp with JavaScript. Here is my question. On one of my websites there are three frames: One named title, another named nav, and another named main. On the nav frame there is a button that when clicked I want to open up a php page in the main frame.

I tried doing
<input type="button" value="Home" onClick="window.location='main.php'">

But as you probably know that just changes that frames location to main.php but I want it to change the frame main to that page.

Anyone have know how to do this?

Thanks for all help provided.

-Nigma
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

There is a clientside forum.

try

Code: Select all

<form action="main.php" target="framename">
<input type="submit" value="Home" />
</form>
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Thanks a bunch! I also just found out that you can do:

<input type="button" value="Home" onClick="parent.main.location.href='home.html'">

I would have never thought of doing it the way you said.

Thanks for responding so quikly and answering my question without chewing me out about it being a JavaScript one ; )

-Nigma
Post Reply