From cbc6224ad360f8fed8d6f89358a4cd3887e52bf1 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 1 Dec 2022 14:01:15 +0000 Subject: [PATCH] [Callsign Lookup] Return Callsign in json request and match to input when looking a callsign up --- application/controllers/Logbook.php | 1 + assets/js/sections/qso.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index de19ebf5..1470c924 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -124,6 +124,7 @@ class Logbook extends CI_Controller { $this->load->model('logbook_model'); $return = [ + "callsign" => strtoupper($callsign), "dxcc" => false, "callsign_name" => "", "callsign_qra" => "", diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index c72c8f53..52177ad8 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -360,8 +360,9 @@ $("#callsign").focusout(function() { // Replace / in a callsign with - to stop urls breaking $.getJSON('logbook/json/' + find_callsign.replace(/\//g, "-") + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result) { - // Make sure the typed callsign and temp callsign match - if($('#callsign').val = temp_callsign){ + + // Make sure the typed callsign and json result match + if($('#callsign').val = result.callsign) { if(result.dxcc.entity != undefined) { $('#country').val(convert_case(result.dxcc.entity));