1
In the case below I am sending the ID data: id_motor... And if I want to send another ID together, like the id_motor and the id_model, as I would?
$(function(){
$('#id_motor').change(function(){
if( $(this).val() ) {
$('#id_ano').hide();
$('.carregando').show();
$.getJSON('sub_ano.php?search=',{id_motor: $(this).val(), ajax: 'true'}, function(j){
var options = '<option value="">Escolha o Ano</option>';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].id + '">' + j[i].ano + '</option>';
}
$('#id_ano').html(options).show();
$('.carregando').hide();
});
} else {
$('#id_ano').html('<option value="">– Escolha o Ano –</option>');
}
});
});
On the other side I’m recovering like:
$id_motor = $_REQUEST['id_motor'];
and would have to recover another, example:
$id_motor = $_REQUEST['id_motor'];
$id_template = $_REQUEST['id_template'];