Click to See Complete Forum and Search --> : javascript over frames?


muratisik
11-22-2003, 02:59 PM
Hello,
I am very new to web designing and what I would like to ask involves both javascript and php. But I feel it is closer to javascript.

I have a web page with two frames, vertically seperated, left one being thin with buttons in it and right one being a php page.

At the first load of the page, some variable on the right php page (like $example) has no value. What I am trying to accomplish is that when the user presses a button on the left frame, some javascript will work and reload the right hand frame and give the variable some new value, like $example=5

I had done this on a single frameless php page where the button at the end of the page served the same purpose. When the page was relaoded after the button was pressed $example had a new value through HTTP_POST_VARS.

Is this possible? If yes, how? I have desperately searched the net but found no answer. I will be very glad if you help:)

Thanks in advance...

Have a nice day

Murat Isik

Dfenestr8
11-23-2003, 04:03 AM
I'm no coder, just an amateur. But I had much the same problem a little while ago. I managed to solve it with a couple of lines of crude, amateurish javascript.

Maybe a variation on my solution might help you ......

Let's assume that your script is called rframe.cgi

In the <head> of the left Frame put...


<script language = "javascript">
<!-- hide from older browsers

function loadRightFrame()
{
parent.RightFrame.location = 'rframe.cgi?examnple=5'
}

//-->
</script>


In the body of the left Frame, put .....


<form>
<input type = "button" value = "press" onClick = "loadRightFrame()">
</form>



Try experimenting with it.