Ver Mensaje Individual
  #5 (permalink)  
Antiguo 29/08/2006, 01:19
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 4 meses
Puntos: 61
Entiendo.

Entonces más sencillo aún. La página quedaría así:

Código:
<html>
<head>
	<title>Untitled</title>
	<script>
var pepepe;
	
	function enviar(caja1,caja2,caja3){
		document.forms['pepote']['pepe'].value=caja1
		document.forms['pepote']['pepe1'].value=caja2;
		document.forms['pepote']['pepe2'].value=caja3;
		pepepe.close();
	}
	
	
	</script>
</head>

<body>
<form name="pepote">
<input type="button" name="buscar" id="buscar" value="Buscar" onclick="pepepe=window.open('buscar2.html','pepepe','width=400,height=200');"><br>

<input type="text" name="pepe"><br>
<input type="text" name="pepe1"><br>
<input type="text" name="pepe2"><br>
</form>


</body>
</html>
Y en la popup:
Código:
<html>
<head>
	<title>Untitled</title>
	<style>td,input{font:normal 10px/20px verdana;}</style>
</head>

<body>
<table>
<tr><td><strong>Nombre:</strong></td><td id="nombre">Pepito Pérez</td></tr>
<tr><td><strong>Dirección:</strong></td><td id="direccion">Calle Roja, 3</td></tr>
<tr><td><strong>Odia el:</strong></td><td id="odia">Chocolate con pimienta</td></tr>
<tr><td colspan="2"><input type="button" value="Cargar estos datos" onclick="opener.enviar(document.getElementById('nombre').innerText,document.getElementById('direccion').innerText,document.getElementById('odia').innerText)"></td></tr>
</table>


</body>
</html>
Si aparecen varios resultados sería fácil con php o con ASP ir individualizando los resultados del popup de forma que mande sólo el resultado que interesa. Sería con un contador y añadiendo ese contador al id de las tablas. Algo así:
Código PHP:
<?
while($pepe=mysql_fetch_array($loquesea)){
$a+=1;
?>
<table>
<tr><td>
<strong>Nombre:</strong>
</td>
<td id="nombre<?=$a;>">
<?=$pepe['nombre'];?>
</td>
</tr>
<tr>
<td>
<strong>Dirección:</strong>
</td>
<td id="
direccion<?=$a;>">
<?=$pepe['direccion'];?>
</td>
</tr>
<tr>
<td>
<strong>Odia el:</strong>
</td>
<td id="
odia<?=$a;>">
<?=$pepe['odia'];?>
</td>
</tr>
<tr>
<td colspan="
2">
<input type="
button" value="Cargar estos datos" onclick = "opener.enviar(document.getElementById('nombre<?=$a;>').innerText,document.getElementById('direccion<?=$a;>').innerText,document.getElementById('odia<?=$a;>').innerText)">
</td>
</tr>
</table>
}
Espero que me haya sabido explicar...
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.