$(document).ready(function () {

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

    function getDetail() {
        var memno = $(".memno").val();

        if (memno != "") {

            $.ajax({
                type: "POST",
                dataType: "json",
                url: "getrationdonate.php",
                data: { memno: memno },
                success: function (response) {
                    if (response != "") {
                        var memname = response.memname,
                            add1 = response.add1,
                            add2 = response.add2,
                            add3 = response.add3,
                            mobile = response.mobile,
                            gender = response.gender,
                            marstat = response.marstat,
                            bloodgrp = response.bloodgrp,
                            phydis = response.phydis,
                            qualification = response.qualification,
                            occupation = response.occupation;


                        $('.memname').val(memname);
                        $('.add1').val(add1);
                        $('.add2').val(add2);
                        $('.add3').val(add3);
                        $('.mobile').val(mobile);
                        $('.gender').val(gender);
                        $('.marstat').val(marstat);
                        $('.bloodgrp').val(bloodgrp);
                        $('.qualification').val(qualification);
                        $('.phydis').val(phydis);
                        $('.occupation').val(occupation);

                        if (memname == "") {
                            alert("Member No. " + memno + " Has Not Filled Ramzan Ration Form");
                            $('.memno').val("");
                            $('.memno').focus();
                        }
                    }


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


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



});