I'm doing a sales module and with a button I go to the list of clients. When you click on a row of the table I want in the AJAX request to call l index and pass the client as a parameter to consult it in the ready. Because I do not want to use sessions because it's not a sales cart, it's a spontaneous sale in a store.
$('#clientes tbody').on('click','tr', function(evt){
$(this).find('input:radio').prop('checked', true);
var idc= $('input:radio[name=seleccion]:checked').attr("id");
alert(idc);
var accion = 'asociar';
$.ajax({
type: "POST",
data: {"idc":idc,"accion":accion},
error: function(){
alert("error petición ajax");
},
success: function(data){
window.location.href ="index.php?controller=venta&action=index?id=".idc;
}
});
}); });
asked by Caruso 13.11.2018 в 14:04
source