I want to get the value from previous drop down value, i use this below code to get the value but it seems doesn't works.
Value 1
$(document).ready(function () {
$('#notification_id select').change(function () {
var selLang = $(this).val();
console.log(selLang);
$.ajax({
url: "<?php echo base_url(); ?>/Bnotifications/ajax_notif_languange",
async: false,
type: "POST",
data: "notification_lang="+selLang,
dataType: "html",
beforeSend: function(data) {
$('#notiflang').html('<img src="<?php echo base_url(); ?>/template/images/loader.gif" alt="" width="24" height="24">');
},
success: function(data) {
$('#notiflang').html(data);
},
})
});
});
ajax that i want to get the value
$(document).ready(function () {
$('body').on('change','#notiftitle select',function () {
var selTitle = $(this).val();
var selLang = $("#notiflang").val();
console.log(selTitle);
$.ajax({
url: "<?php echo base_url(); ?>/Bnotifications/ajax_notif_message",
async: false,
type: "POST",
data: "notification_title="+selTitle+'¬ification_lang='+selLang,
dataType: "html",
beforeSend: function(data) {
$('#notification_message').html('<img src="<?php echo base_url(); ?>/template/images/loader.gif" alt="" width="24" height="24">');
},
success: function(data) {
$('#notification_message').html(data);
},
})
});
});
i use this value and put on code above, but it seems not getting the value from value 1, how to get the value from previous ajax dropdown.
var selLang = $("#notiflang").val();