...

View Full Version : need help with this plz



daraptor
02-02-2007, 07:30 PM
hey guyz....am tryin to populate parent window from the child window usin a href link...its like in parent window there is a textbox with hyperlink which needs to be populated by child window.....in the child window i perform a search and from the search results when i hit the href link in search results...the text in the child window should populate the parent window textbox....and puttin my parent and child window....can someone plz add what needs to be added to it....i did it my self but...evertyhin is workin fine....but when i hit the href in child window....it is populatin the parent window but not with the text i got in search results...i can see "text Field" in the parent window text box...am not sure what to add to this but plz help me by addin what is necessary to it.....

this is parent window (test.html)

<head>
<script>
function loadParent() {
pWindow = opener.window;
pWindow.document.getElementById("textField").value = "Text Field";
pWindow.document.getElementById("contentArea").innerHTML = "Content from child window";
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Travel Search</title>

<link href="myCSS.css" rel="stylesheet" type="text/css" />
</head>

<body>
<a href="ex.html" target="_blank">New window</a>
<form>
<input type="text" id="textField">
</form>
<div id="contentArea"></div>
</body>

this is child window (ex.html)

<head>
<script>
function loadParent() {
pWindow = opener.window;
pWindow.document.getElementById("textField").value = "text Field";
pWindow.document.getElementById("contentArea").innerHTML = "Content from child window";
window.close()
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<table width="200" border="1">
<tr>
<td><a href="#" onclick="loadParent()">populate parent</a>#post.code#</td>
</tr>
</table>
</body>

so when i click the href the text which am seein in the parent window..i highlighted it with red color....so plz add what is necessary to the code guyz.....thanx....

Mr J
02-03-2007, 08:41 AM
Try it this way

test.html


<HTML>
<HEAD>
<TITLE>Travel Search</TITLE>
<link href="myCSS.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>

<a href="ex.htm" target="_blank" onclick="window.open(this.href);return false">New window</a>

<form>
<input type="text" id="textField">
</form>
<div id="contentArea"></div>

</BODY>
</HTML>


ex.html remains the same

daraptor
02-04-2007, 06:07 AM
Try it this way

test.html


<HTML>
<HEAD>
<TITLE>Travel Search</TITLE>
<link href="myCSS.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>

<a href="ex.htm" target="_blank" onclick="window.open(this.href);return false">New window</a>

<form>
<input type="text" id="textField">
</form>
<div id="contentArea"></div>

</BODY>
</HTML>


ex.html remains the same

hey man...i tried what u told but...the problem is ....when i hit the href link it is populatin the parent field but it is populatin by the name "text Filed" i dont know y...but whenever i hit the href link am seein the word"text Field" in the parent text box.....can u plz tell me what is wrong



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum