Location.Href of a Popup Window

OK, here's the thing. I have a window that is opening a popup by way of form with a target tag. It must be done this way because the popup is an external site that needs the form data. The name I am giving the new window is "newwin". Is there a way to change the location.href attribute of the popup window from the parent doing this? I tried newwin.location.href, parent.newwin.location.href, newwin.document.location.href all to no avail. I know that normally you would specify a variable using var mywindow = window.open("","newwin") then say mywindow.location.href="". I also know that you can direct to a frame by using parent.frame1.location.href="". Not sure how to use the window name to refer to a popup. Please help.
LVL 1
j0kStAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LakioCommented:
<html>
<head>
<title>Lakio's popup location thing</title>
<script type="text/javascript">
function popme(x){
if(x) {newwin.location="http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21797371.html";}
else {newwin=window.open("", "newwin","width=350,height=300");}
}
</script>
</head>
<body>
<a href="#" onclick="popme(0);return false">1. Open</a> | <a href="#" onclick="popme(1);return false">2. new location for that popup</a>
</body>
</html>
j0kStAAuthor Commented:
OK, I think my question may have been a bit confusing. I have a page similar to the following:

<html>
<form name='myform' action="http://www.google.com" method="POST" target="newwin">
<input type='hidden' value='something'>
</form>
<script language="JavaScript">
document.myform.submit();
newwin.location.href="http://www.yahoo.com"
</script>
</html>

It's the newwin.location.href="http://www.yahoo.com" that doesn't work. Is there a way to change the location.href of the window by just using the window name? You can do it with an href by doing the following <a href="http://www.yahoo.com" target="newwin">Click Here</a>, but I need it to redirect without having to click a link.
LakioCommented:
ok,
I made two ways for you (desperately trying to get a A)

<html>
<form name='myform' action="http://www.google.com" method="POST" target="newwin">
<input type='hidden' value='something'>
</form>
<script language="JavaScript">
//document.myform.action="http://www.yahoo.com";
document.myform.submit();
//window.open("http://www.yahoo.com", "newwin");
</script>
</html>

just del the // in front the one you like (Im guessing window.open)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
j0kStAAuthor Commented:
Perfect! I can't believe I didn't think about using window.open. I was so hung up on the location.href deal that I didn't think about other option. Thanks.
LakioCommented:
or action ;) no problem m8
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.