Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/11/2012, 06:39
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 19 años, 5 meses
Puntos: 43
Respuesta: ajax y submit

solucionado, por si alguno le interesa el código final queda asi:
Código Javascript:
Ver original
  1. $(function() {
  2.         $('#comprar').click(function(){
  3.             $.ajax({
  4.                 type: 'POST',
  5.                 url: '<?php echo base_url('index/guardar_pedido');?>',
  6.                 data: $("#formpagar").serialize(),
  7.                 crossDomain: true,
  8.                 success: function(data){
  9.                    if(data.error){
  10.                        alert(data.error);
  11.                    }
  12.                    else{
  13.                        var custom = '<input type="hidden" name="custom" id="custom" value="'+ data.custom +'" />';
  14.                        $("#formpagar").append(custom);
  15.                        document.getElementById("formpagar").submit();
  16.                    }
  17.                 }
  18.             });
  19.         });
  20.  
  21.     })

lo que hice fue ejecutar el submit por javascript natural:
Código Javascript:
Ver original
  1. document.getElementById("formpagar").submit();