The first File is: form.php
.
I can't send the values (1 or 2) to my other file.
Can anyone help me out?
$(function () {
$('#cod_cidades').change(function () {
if ($(this).val()) {
$('#s').hide();
var valor = ($(this).val());
$('.carregando').show();
$.getJSON('vara.ajax.php', { cod_cidades: $(this).val(), ajax: 'true' }, function (j) {
var options = '<option value=""></option>';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].s + '">' + j[i].nome + '</option>';
}
$('#s').html(options).show();
$('.carregando').hide();
});
} else {
$('#s').html('<option value="">– Escolha um estado –</option>');
}
});
});
Varas.ajax.php
This is the part that i get the value.
$id_cidade = mysql_real_escape_string( $_REQUEST['cod_cidades'] );