$(document).ready(function () {
  $("body").on("change", ".flatno", getCustname);

  function getCustname() {
    var flatno = $(".flatno").val();

    $.ajax({
      type: "POST",
      dataType: "json",
      url: "getreminder.php",
      data: { flatno: flatno },
      success: function (response) {
        if (response != "") {
          var accode = response.accode;

          $(".party").val(accode).trigger("change");
        }
      },
      error: function (request, textStatus, errorThrown) {},
    });
  }
});
