diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index c2385bef..ceb493e5 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -139,10 +139,12 @@ function qso_edit(id) { }); $('#locator').change(function(){ - $('#locator_info').load("logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); - $.get('logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { - document.getElementById("distance").value = result; - }); + if ($(this).val().length >= 4) { + $('#locator_info').load("logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); + $.get('logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { + document.getElementById("distance").value = result; + }); + } }); $('#sota_ref_edit').selectize({