Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/11/2004, 08:26
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 5 meses
Puntos: 61
Dime que te parece este codiguillo que he hecho para tí:

Código HTML:
<html>
<head>
	<title>Untitled</title>
	<script>
	function anadir(){
	juan=window.open('about:blank','juan','width=300,height=200');
	juan.document.write("<html><head><title>Añadir opcion</title></head><body>");
	juan.document.write("<form>Introduzca el texto de la nueva opción: <input type='textbox' name='texto'><br>");
	juan.document.write("Introduzca el valor de la nueva opción: <input type='textbox' name='texto'><br>");
	juan.document.write("<input type='button' value='añadir' onclick='opener.anadir2()'>");
		juan.document.write("</form></body></html>");
	}
	function anadir2(){
	texto=juan.document.forms[0][0].value;
	valor=juan.document.forms[0][1].value;
	opcion=new Option(texto,valor);
	combo=document.forms[0]['pepe'];
	combo.options[combo.options.length]=opcion;
	juan.close();
	}
	</script>
</head>

<body>
<form>
<select name="pepe">
<option value="1">01
</select>
<input type="button" onclick="anadir()" value="Nueva opción">
</form>


</body>
</html> 
__________________
Cómo escribir

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