Premesso che secondo me è meglio aprire una pagina esistente e non dinamica, cosi funziona
codice:
function autoPopup(numLotto) {
var stili = "top=10, left=10, width=200, height=100, status=no, menubar=no, toolbar=no scrollbar=no";
var testo = window.open("", "", stili);
testo.document.write("<html>\n");
testo.document.write("<head>\n");
testo.document.write("<title>Prezzo Lotto Venduto</title>\n");
testo.document.write("</head>\n");
testo.document.write("<body background=../sfondo.gif><form id=popup>\n");
testo.document.write("Inserirsci il prezzo del Lotto "+numLotto+"");
testo.document.write("<input type=\"text\" id=\"pr_ven\"><a href=\"javascript: window.opener.document.getElementById('Totale').value=document.getElementById('pr_ven').value;self.close()\">Salva</a>\n");
testo.document.write("</form></body>\n");
testo.document.write("</html>");
}
sostituisci "Totale" con il tuo id nella pagina madre