$(document).ready(function () {

    $("body").on("blur", ".memno, .sonno, .fathno, .dauno", getDetail);

    function getDetail() {
        var memno = $(".memno").val(),
            sonno = $(".sonno").val(),
            fathno = $(".fathno").val(),
            dauno = $(".dauno").val();

        $.ajax({
            type: "POST",
            dataType: "json",
            url: "getpermarriage.php",
            data: { memno: memno, sonno: sonno, fathno: fathno, dauno: dauno },
            success: function (response) {
                if (response != "") {
                    var memname = response.memname,
                        sonname = response.sonname,
                        fathname = response.fathname,
                        sagai = response.sagai,
                        lagan = response.lagan,
                        dauname = response.dauname;

                    $('.memname').val(memname);
                    $('.laganamt').val(lagan);
                    $('.sonname').val(sonname);
                    $('.fathname').val(fathname);
                    $('.dauname').val(dauname);


                }
            },
            error: function (_request, _textStatus, _errorThrown) {
            }
        });


        var totamt = parseFloat($(".laganamt").val()) + parseFloat($(".laganamt").val());
        $('.totamt').val(totamt);
    }



});