[thelist] JS?: Target = opener?

John Olival johnolival at yahoo.co.uk
Wed Dec 5 17:32:30 CST 2001


> Anybody know a way to specify, as the target of a form, the opener of
> the window that contains the form?
>
> I tried this:
>
> <!--
> function frmHandler(frm)
> {
> var MW = window.opener.name;
> frm.target = MW;
> frm.submit();
> return true;
> }
> // -->

Tab, you need to give the window.opener a name before you can refer to it by
name so when you run your script to open the window, do this:

function openWindow()
{
window.name='windowOpener';
window.open('form.html','newWindow');
}

And then the script in the newWindow as you have it above will work.

HTH

JohnO


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com





More information about the thelist mailing list