Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 02-05-2007, 01:01 PM need help with this
Junior Talker

Posts: 1
Trades: 0
hello there.....
am a newbie....plz bear with me....i have a parent window.....in the parent there is a text box with a link which opens a new window...when i click the link ...a popup will open....i do some search in the popup and get some results...when i click the result....it should pass to the parent from the popup....if u r gettin confused...go to sidestep.com......in this site....u can see airport code....so when u click airport code....it will open a popup window....in that popup window type in a airport code or city and hit search....then it will display the results....then when u hit on the result...the popup will close and it will populate the parent window.....i wanna know how to do this...is there a example code or a script to do that...can some one tell me in detail what to do......plz guyz am a newbie.....and am a little confused....plz help me with this.....thanx.....
newbie_paul is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-06-2007, 01:37 AM Re: need help with this
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
Here goes the solution (please modify as per your requirements):

Parent.html:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
 
</script>
</head>
<body>
<form method="get" name="form1">
<input name="txt" type="text">
<a href="#" onclick="popUpWindow('child.html', 50, 50, 200, 200)">Click to Open Child</a>
</form>
</body>
</html>
 

Child.html:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form method="get" name="form1">
<input name="txt" type="text">
<a href="#" onclick="window.opener.document.form1.txt.value=document.form1.txt.value; window.close();" >Click to Set Value in Parent</a>
</form>
</body>
</html>
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to need help with this
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.17484 seconds with 12 queries