INDEX.HTML
<html> <head> <title>Index</title> <script language=javascript> function busca(mypage, myname, w,h, scroll){ var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height=' + h + ', width=' + w + ', top=' + wint + ', left=' + winl + ', scrollbars=' + scroll + ', resizable'; win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); return false; } return false; } </script> <script language=javascript> function fazer_algo( sText ) { valor = sText; } </script> </head> <body> index <input type=text name='teste' onChange="fazer_algo(document.write(this.valor))"> <a href="#" onclick="busca('popup.html', 'busca', width=400, height=300);">busca</a> </body> </html>
POPUP.HTML
<html> <head> <title>Popup</title> <script language='JavaScript'> function enviar_comando() { var sText = window.document.forms['form'].elements['text'].value; opener.fazer_algo( sText ); } </script> </head> <form name='form' action='_blank' method='post'> <input type='text' name='text' value='valor_para_o_index'><br> <input type='button' name='button' value='Clique' onclick='enviar_comando(); '> </form> <body> </body> </html>
Grato