![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
26/11/2004, 16:27
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Un ejemplo:
formulario: Código HTML: <html>
<head>
<title>Untitled</title>
</head>
<body>
<form name="form1" method="post" action="XXXXX.asp" enctype="multipart/form-data">
<p>
Apellido: <input name="Apellido" type="text" size="30" maxlength="30"><br>
Nombre: <input name="Nombre" type="text" size="30" maxlength="30"><br>
<a href="" onClick="window.open('pp.html','','width=300,height=300');return false;">Habilidades</a>
<input name="b2" type="submit" value="Enviar"><br>
<input type="text" name="cat[0]" >
<input type="text" name="cat[1]" >
<input type="text" name="cat[2]" >
<input type="text" name="cat[3]" >
</form>
</body>
</html> Y pp.html: Código HTML: <html>
<head>
<title>Untitled</title>
</head>
<body>
<script language="javascript">
contador=0;
function limitarSelección(casilla,form){
if (contador == 3 && casilla.checked){
alert("Solo puedes seleccionar 4 opciones");
return false;
}
pepe=casilla.name;
opener.document.forms[0].elements[pepe].value=(casilla.checked)?casilla.value:"";
contador+=(casilla.checked)?1:-1;
}
</script>
<input type="checkbox" name="cat[0]" value="Recepción" onClick="return limitarSelección(this,this.form)">
<input type="checkbox" name="cat[1]" value="Administacion" onClick="return limitarSelección(this,this.form)">
<input type="checkbox" name="cat[2]" value="Telefonia" onClick="return limitarSelección(this,this.form)">
<input type="checkbox" name="cat[3]" value="Consultas" onClick="return limitarSelección(this,this.form)">
</body>
</html> Los input que he añadido como text los debes poner como hidden. Los he puesto así para que veas el efecto. Así, al enviar el formulario mandas tb los datos del pop up.
¿Sería más o menos eso lo que quieres?
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |