Ver Mensaje Individual
  #40 (permalink)  
Antiguo 29/04/2012, 11:10
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

gildus gracias por responder

tengo una pregunta

en el formulario tengo <input type="text" name="nombre" id="nombre">

tengo que definir una variable que almacene este valor,
dicha variable la tengo que colocar en $('#enviar').on('click',function() { .......

Código Javascript:
Ver original
  1. $('#enviar').on('click',function() {
  2.                     var arrayOpt = new Array;
  3.                     $('input[type=checkbox]').each(function() {
  4.                         if ($(this).attr('name') == 'opcion[]') {
  5.                             if ($(this).attr('checked') == 'checked') {
  6.                                 arrayOpt.push($(this).val());
  7.                                
  8.                             }
  9.                         }
  10.                     });
  11.                    
  12.                     $.ajax({
  13.                         url:'recibio.php',
  14.                         type:'post',
  15.                         data: 'opciones='+arrayOpt,
  16.                         success: function(datos) {
  17.                         $('#respuesta').html(datos);
  18.                                             alert(arrayOpt);}
  19.                     });
  20.                                        
  21.                     return false;
  22.                 });