after trying, trying again, and keep trying.... finally I succeeded...
I share it here for anyone who might need it....
var jml = 0;
var hrg = 0;
var tot = 0;
$(document.body).on('change',"#ctrl-Produk",function (e) {
var pro = $("#ctrl-Produk option:selected").text();
pro = pro.replace(/ /g,'');
let arrpro = pro.split('|');
$('input[name="Satuan"]').val(arrpro[1]);
$('input[name="Harga"]').val(arrpro[2]);
hrg = arrpro[2];
setTotal();
});
$(document.body).on('change keyup input', 'input[name="Jumlah"]', function() {
jml = $(this).val();
setTotal();
});
$(document.body).on('change keyup input', 'input[name="Harga"]', function() {
hrg = $(this).val();
setTotal();
});
function setTotal() {
tot = parseInt(jml, 10) * parseInt(hrg, 10);
$('input[name="Total"]').val(tot);
};
Thank you so much @willvin for your response and support.....