I want to get hyperlink Name from child window to be displayed on textbox in parent window. Plz help me.
Here are my two files:
This is trial1.php file:
Code: Select all
<?php
?>
<html>
<body>
<script>
function my(){
var myW = window.open("trial2.php","","width=200,height=200");
}
</script>
<form id="MyF" name="M1">
<input type="text" name="txt1" id="t1">
<input type="button" name="btn" onclick="my();" value="Click">
</form>
</body>
</html>
This is trial2.php file:
<?php
?>
<html>
<body>
<script>
function tam(){
window.opener.document.M1.txt1.value=document.getElementById('tk').value;
window.close();
}
</script>
<form id="tk">
<p><a href="" onclick="tam();">Love</a></p>
</form>
</body>
</html>