Re[2]: [PHP-ES] Off Topic: Ayuda con Java Scritp por favor!!!

From: Date: Tue, 11 Dec 2001 02:57:57 +0000
Subject: Re[2]: [PHP-ES] Off Topic: Ayuda con Java Scritp por favor!!!
References: 1 2 3  Groups: php.general.es 
Request: Send a blank email to general-es+get-16540@lists.php.net to get a copy of this message
Hola Pablo, Ah, ok. Bueno, haz esto, no use el radio, pero el principio es el mismo: (lo probe con IE, no te aseguro que jale en NS). <html> <head> <title></title> </head> <body> <form name="forma"> <select name="campo" onChange="miFuncion()"> <option value="cero">----</option> <option value="uno">quiero</option> <option value="dos">no quiero</option> </select> <select name="elotrocampo" style="width: 204px; height: 153px"> <option value="A"><- selecciona algo</option> </select> <script language="javascript"> function miFuncion() { var list = document.forma.campo; var opciones = getValores(list.options[list.selectedIndex].value); updateOpciones(opciones); } function updateOpciones(arr) { var list = document.forma.elotrocampo; list.options.length = 0; list.options.length = arr.length; for (i=0; i<arr.length; i++) { list.options[i].text = arr[i]; list.options[i].value = arr[i]; } list.selectedIndex = 0; } function getValores(campo) { if (campo == "uno") return new Array("Ciudad 1","Ciudad 2","Ciudad 3","Ciudad 4"); if (campo == "dos") return new Array("Elegi NO!!!"); return new Array("<- selecciona algo"); } </script> </form> </html> Monday, December 10, 2001, 8:28:12 PM, mandastes esto: PC> En primer lugar, gracias Jorge por contestar tan rápido. PC> No me expliqué bien. Lo que quiero es que en la misma página, cuando elija PC> sí en radio button en un combo box al lado automáticamente me muestre entre PC> determinadas opcioens. Si elijo no, no me muestre las opcioens sino que PC> ponga el texto en el combo "Elegí No". PC> Es similar a cuando en un combo elegís un continente, y en el de al lado PC> elegís un país de ese continente, y no te muestra los países de otros PC> continentes. PC> Gracias y saludos PC> Pablo _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.general.es (#16540) next »