newbie here. I have a weird issue here where I two functions in my script. Here is the first function:
$(document).on("click", "#result2 p", function(){
var inv_id = $(this).text();
$.get("autocomplete_inv.php", {term: inv_id}).done(function(data){
var inv_info = jQuery.parseJSON(data);
$('#prod_id_'+id).val(inv_info[0]);
$('#prod_type_'+id).val(inv_info[1]);
$('#prod_colour_'+id).val(inv_info[2]);
$('#prod_price_'+id).val(inv_info[3]);
console.log('Have Data Here:',$('#prod_price_1').val());
});
$('#result2').empty();
sumPrice();
});
And here is the second function:
function sumPrice(){
console.log('No Data here:',$('#prod_price_1').val());}
The problem is, the output console.log('Have Data Here:',$('#prod_price_1').val());
only shows is the first function and not the second function. I still can't figure out what's the issue here!
Here is the screenshot: Screenshot
Can anyone helps me on this matter? I've been stuck at this part for almost a week. I would sincerely appreciate your answer(s) very much!