Click to See Complete Forum and Search --> : send url to external webpage opened via a form


llamatron
08-29-2003, 03:59 PM
I have a main window that submits a form to a website and opens up the results in a new window,
the action of the form is an external webpage. :

<form name="form1" method="post" target="_blank" action="http://www.externalpage.com/external.asp" >

and I obviouslly have a submit button :

<input name="submit" type="submit" value="Submit">

However I want to communicate with this new window and change the URL of it after the page has been fully loaded,
automatically.
How do i reference the new window to do this?

-------------------------------------------------------------------------------------------------------------

I have tried doing this :

<input name="submit" type="submit" value="Submit" onsubmit"=newin()">

where newin is the following function :

function newin()
{
var new_window = window.open("http://www.externalpage.com/external.asp","html_name","width=200,height=600");
}

I tried changing onsubmit="newin()" to onclick"=newin()" but it still did nothing. But I think this somehow conflicts with the form submit method? How do I name the externalpage.asp window as a variable so I can communicate with it and send a URL to it?
Thanks,

Khalid Ali
08-29-2003, 04:56 PM
from what you have described,It seems like you are trying to access the page that is being served from an external domain.with in the browser security paradigm its not possible to affect an external resource other then that which is from your own server.

In simple words you can not do that.:(

llamatron
08-30-2003, 12:19 AM
Not entirely true Khalid from what I have since found out. If I now change the form to read:

<form name="form1" method="post" target="popup" action="http://www.external.com/external.asp" onsubmit="window.open ('about:blank','popup','width=300,height=300');">

and put the following link into the main page :

<a href="http://www.external.com/external.asp?anyparameters" target="popup">link text</a>

When I click this link, the link opens up in the popup-page and correctly displays the data i want. However i want this link to be loaded automatically not as a clickable link from the main page (there doesn't appear to be a target="" for windows.location.href). Have you any idea how I can do this?
Apologies if you misunderstood what I was asking for.
Thanks again,