By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Noob: popus, frames and forms

P: n/a
I'm hoping this won't be too hard with Javascript (I'm new to the
language).

I've got a page with a form on it (name=frm1) which has a text input
(name=url).
I want to be able to click a link that will open a popup that has 2
frames. The top frame (frameA) will have a button/link that, when
clicked, will do 2 things:
1. Insert the URL of frameB (the bottom frame) into the text box "url"
on the original page
2. Close the popup
Here's my setup so far:
change.shtml has
<head>
<!-- Script
function load() {
var load =
window.open('changeurl.html','','scrollbars=no,men ubar=no,height=600,width=800,resizable=yes,toolbar =no,location=no,status=no');
}
// -->
</Script>
</head><body>
<a href="javascript:load()">Click here</a>

changeurl.html simply sets up the two frames, frameA (changea.html) and
frameB (www.domain.com)

changea.html is where I need the button that does the above 2 points.
(No idea how to make this page).

I appreciate any help,

henry

Jan 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
So now in change.shtml I have:
<html><head>
<script type="text/javascript">
function load() {
var load =
window.open("changeurl.html",
"myPopup",
"height=600,width=800,resizable");
}
</Script>
</head><body>
<form name="frm1" action="change.pl" method="post">
<a href="#" onclick="load();return false">Click here</a>
<input type='text' size=60 name='url' value='http://www.'>
</form>
</body></html>

And in changea.html I have:
<html><head>
<script language="JavaScript">
function closeWindow() {

top.opener.document.forms[0].url.value=top.frameB.document.location.href;
top.window.close();
}
</script>
</head><body>
<form>
<input type=button value="Close Window" onClick="closeWindow();">
</form>
</body></html>

The content of frameB will be on the same server so that's ok. But this
doesn't work. It doesn't insert the value or close the window. What
have I done wrong?
Thanks again,

Henry

Jan 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.