
	$(document).ready(function () {
  // Send Search Text to the server
  $("#fromCity").keyup(function () {
    let searchText = $(this).val();
    if (searchText != "") {
      $.ajax({
        url: "iata_from_city.php",
        method: "post",
        data: {
          query: searchText,
        },
        success: function (response) {
          $("#show-list").html(response);
        },
      });
    } else {
      $("#show-list").html("");
    }
  });
  
  // Set searched text in input field on click of search button
  $(document).on("click", "#show-list a", function () {
    $("#fromCity").val($(this).text());
    $("#show-list").html("");
  });
  });
  
  
	