I have a select, lets call it A. When i choose an option from A, with ajax, i load an another select with options into a div. Lets call this second select B.
I have some ajax onchange code on B, but it does nothing, and it gives no error also.
I think, the "site doesnt see the B select", because it isnt in the source code, ajax loads it into a div.
What would be the solution for this?
$('#fizetes_select').on('change', function() {
var SelectedValue = this.value;
if(SelectedValue != 0 )
{
$.ajax({
type: 'POST',
url: 'files/get_fizetes_text.php',
data: { id: SelectedValue },
dataType: "html",
cache: false,
beforeSend: function(){
$('#preloader_fizetes').show();
},
success: function(data)
{
var result = $.trim(data);
$('#fizetes_result').html(result);
},
complete: function(){
$('#preloader_fizetes').hide();
}
});
}
return false;
});
Thats the onchange code for the B select, i only want to display some text with it. The ID-s are correct, i didnt write it bad, i chekced. Its in document ready.