Ver Mensaje Individual
  #20 (permalink)  
Antiguo 24/04/2012, 05:15
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Respuesta: Envio de correo a varios destinatarios con phpMailer

tengo una duda cuando le doy enviar tengo en la url

http://localhost/prueba/?nombre=Montes&opcion[]=ohmq22%40hotmail.com&contador=ninguno&Submit=Envi ar

espero me corrigan



para mi estoy enviando unas variables
nombre
el array opcion[]
contador

pero no recibo nada

que estoy haciendo mal?

en el codigo que me proporciona Nemutagk , veo que data: 'opciones='+arrayOpt,

pero al ver la url el array se llama opcion[]=


Código Javascript:
Ver original
  1. <script type='text/javascript'>
  2. //<![CDATA[
  3. $(document).on('ready',function() {
  4.                 $('#chk_todos').on('click', function() {
  5.                     $('input[type=checkbox]').each(function() {
  6.                         if ($(this).attr('name') == 'opcion[]') {
  7.                             if ($(this).attr('checked') != 'checked') {
  8.                                 $(this).attr('checked','checked');
  9.                             }else {
  10.                                 $(this).removeAttr('checked');
  11.                             }
  12.                         }
  13.                     });
  14.                 });
  15.                
  16.                 $('#enviar').on('click',function() {
  17.                     var arrayOpt = new Array;
  18.                     $('input[type=checkbox]').each(function() {
  19.                         if ($(this).attr('name') == 'opcion[]') {
  20.                             if ($(this).attr('checked') == 'checked') {
  21.                                 arrayOpt.push($(this).val());
  22.                             }
  23.                         }
  24.                     });
  25.                    
  26.                     $.ajax({
  27.                         url:'recibio.php',
  28.                         type:'post',
  29.                         data: 'opciones='+arrayOpt,
  30.                         success: function(datos) {
  31.                             //$('#respuesta').html(datos);
  32.                            
  33.                         }
  34.                     });
  35.        
  36.                    
  37.                     return false;
  38.                 });
  39.             });
  40.  
  41. //]]>
  42. </script>