I will try to detail the question as much as possible, but I do not know how to display an error in this situation, if anyone can help even in this, I thank you.
I'm sending data via POST with Ajax, but one of the fields does not pass value to PHP.
Theproblemisinthemarkfield,ifIwriteadirectvalueandclickthebuttontoinput,IgetthevalueinPHP,butifIrunmybrandsearchesbefore,thevaluedoesnotreachPHP.ButtheJSvariableIassignjustbeforesendingtothePHPpage,hasvalueinbothsituations.
Itdoesnotgenerateanerrorintheconsole.
Ijusttypedthecard,thevaluegoestoPHPandback.
WhenIdefinethevehicletype,PHPdoesnotreturntheresponse,butthevariablealertisfilledin.
//entrada no estacionamento
$("#btnentrada").click(function(event){
//cancelo o evento padrão do botao(submit)
event.preventDefault();
var cliente = $("#tipo").val();
var txtplaca = $("#txtplaca").val();
var cmbtipo = $('#id_tipo').val();
var txtmarca = $("#txtmarca").val();
alert(txtmarca);
var cmbmodelo = $("#cmbmodelo").val();
var cmbcor = $("#cmbcor").val();
var cmbcobranca = $("#cmbcobranca").val();
var txtobs = $("#txtobs").val();
$.ajax({
url: 'insere_entrada.php',
method: 'post',
data: {'cliente': cliente,'txtplaca': txtplaca , 'cmbtipo': cmbtipo , 'txtmarca': txtmarca , 'cmbmodelo' : cmbmodelo , 'cmbcor' : cmbcor ,
'cmbcobranca' : cmbcobranca , 'txtobs' : txtobs},
success: function(data){
$("#resposta").html(data);
},
error: function(ex) {
console.log(ex);
},
})
});