Click to See Complete Forum and Search --> : How can I do this?


zama
07-24-2003, 02:10 PM
I am fairly new to javascript...

I am using the following code to open a form in a new window from my top frame when the submit button (in the top frame)is selected:


function createTarget(t){
window.open("", t, "width=600,height=550");
return true;
}


<CFOUTPUT>


<form name="SiteInfo" method="POST" action="InvAdd_GPS_Point2.cfm"
onsubmit="return createTarget(this.target)" target="formtarget">

<Input Type="Hidden" Name="PT_LAT" value="#PT_LAT#">
<Input Type="Hidden" Name="PT_LON" value="#PT_LON#">
<Input Type="Hidden" Name="EASTING" value="#EASTING#">
<Input Type="Hidden" Name="NORTHING" value="#NORTHING#">
<input type="hidden" name="loginname" value="Susan">
<input type="hidden" name="DTE_ENTERED" value="#Now()#">
<input type="hidden" name="PointType" value="2">




<INPUT type="submit" value="Accept Point" onclick="removeGPSPoint()" >

</FORM></CFOUTPUT>


This is all fine and dandy.

*What I also want to be able to do:

When this new window opens, I want a new page to be loaded into my top frame.

How do I do this? I am likely making this harder than it needs to be..


Thanks for your help, it is appreciated. Let me know if you need me to post more of my code.

Khalid Ali
07-24-2003, 02:41 PM
you need to add a line of code in this function that opens thsi child window

function createTarget(t){
window.open("", t, "width=600,height=550");
return true;
}

sshould be

function createTarget(t){
window.open("", t, "width=600,height=550");
parent.frameName.location,href = "url";
return true;
}

zama
07-24-2003, 03:51 PM
Fabulous!

Thanks for your help