Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/07/2012, 14:05
Avatar de Pablo Ayala
Pablo Ayala
 
Fecha de Ingreso: septiembre-2005
Ubicación: Cancún, México
Mensajes: 231
Antigüedad: 18 años, 6 meses
Puntos: 28
Respuesta: Enviar valores seleccionados de un select dinamicos

hola, por que el each?

Tu lo tienes asi:
Código Javascript:
Ver original
  1. <script language="javascript">
  2.         $(document).ready(function(){
  3.             $("#cmbpais").change(function () {
  4.                 $("#cmbpais option:selected").each(function () {
  5.                     elegido=$(this).val();
  6.                     $.post("estados.php", { elegido: elegido }, function(data){
  7.                     $("#cmbestados").html(data);
  8.                     $("#cmbciudades").html("");
  9.                     });        
  10.                 });
  11.             })
  12.            
  13.         });
  14.     </script>

Que no, deberia ir asi:
Código Javascript:
Ver original
  1. <script language="javascript">
  2.         $(document).ready(function(){
  3.             $("#cmbpais").change(function () {  
  4.                     elegido=$(this).val();
  5.                     $.post("estados.php", { elegido: elegido }, function(data){
  6.                     $("#cmbestados").html(data);
  7.                     $("#cmbciudades").html("");
  8.                     });        
  9.             })
  10.            
  11.         });
  12.     </script>
__________________
Atentamente,

Pablo Ayala.
Si vas a responder algo en el foro que sea con amabilidad.