I want to pass some data by POST using AJAX to insert in database I am working in laravel 5.1.
My question is this:
Is there a limit to the parameters that can be sent by Ajax? Because I have several and if I remove one nothing happens, insert but if I put it gives javascript error.
Code:
$.ajax({
type: 'POST',
url:'/estimates',
dataType:'json',
headers: {'X-CSRF-TOKEN': token},
// data:{DatosEstimado:DatosEstimado,Estimado:Estimado,descuento:descuento,gananciatotal},
data:
{
company_id:company_id,prove_id:prove_id,estado:estado,
fecha_soli:fecha_soli,resumen:resumen,metodo:metodo,
proximo_seguimiento:proximo_seguimiento,
fbo:fbo,cantidad_fuel:cantidad_fuel,localidad:localidad,
avion_id:avion_id,tipoCama:tipoCama,
Estimado:Estimado, descuento:descuento,
totalDescuento:totalDescuento,
gananciatotal:gananciatotal,
total:total,subtotal:subtotal,tipoCategoria:tipoCategoria
},
success: function (estimado) {
$('#mensaje').toggleClass('alert alert alert-success');
$('#mensaje').html(estimado);
console.log(estimado);
// window.location()
// location.href ="/estimates/index";
//Recargar el plugin para que tenga la funcionalidad del componente$("#idMunicipio").select({ placeholder: "Selecciona un Municipio", width: "20%" });
},
//Mensaje de error en caso de fallo
error: function (ex) {
$('#mensaje').toggleClass('alert alert alert-danger');
$('#mensaje').html('Ocurrio un error inesperado: '+ex);
alert('Failed to retrieve states.' + ex);
}
});