Forum Moderators: coopster

Message Too Old, No Replies

About PHP and JavaScript

well is about a script in javascript that I need work in php and html

         

Burbuja

4:18 pm on Feb 23, 2005 (gmt 0)



I have these:

<script type="text/javascript" language="JavaScript">
function goto()
{
if (document.links.one.selectedIndex=="1")
{window.location.href="form.php"}
}
</script>

<FORM name="links">
<h4>Insert</h4>
<SELECT name="one" onChange="goto();">
<OPTION>Choose option</OPTION>
<OPTION value="1">Insert Record</OPTION>
</SELECT>

so the problem is that i need that when i'll change the option, the form.php go to another window(frame), i have a page frame.php inside this are page_frame1.php and page_frame2.php, the selects are in page_frame1.php and i want that clicking in the option these go to page_frame2.php, but i don't know how i'll do that :(
If someone know plsss, could tell me? thx

ironik

11:49 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



You can target pages in frame through javascript by using:

[example]
parent.frames[1].location.href = "page.php";
[/example]

where frames[x] is the array of frames within your page.

You can replace frames[1] with a frame name (say you've called it 'main' because it's where your main content will go):

[example]
parent.main.location.href = "page.php";
[/example]

ironik

11:50 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



Sorry - double post! No flood control on these boards?

coopster

11:57 am on Feb 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



and welcome to WebmasterWorld, Burbuja.

Burbuja

4:03 pm on Feb 24, 2005 (gmt 0)



oooooh thx thx a lot, It works weee :D and thx for the welcome jiji :)

hugs ;)