Remove distance/bearing text if grid is cleared

And also set distance to 0
This commit is contained in:
phl0
2024-04-25 17:32:37 +02:00
parent e132a5f0b6
commit 4726321b1d
2 changed files with 10 additions and 1 deletions

View File

@@ -1258,6 +1258,12 @@ class Logbook_model extends CI_Model {
$lotwrdate = $qso->COL_LOTW_QSLRDATE;
}
if ($this->input->post('distance')) {
$distance = $this->input->post('distance');
} else {
$distance = null;
}
$data = array(
'COL_TIME_ON' => $this->input->post('time_on'),
'COL_TIME_OFF' => $this->input->post('time_off'),
@@ -1271,7 +1277,7 @@ class Logbook_model extends CI_Model {
'COL_RST_SENT' => $this->input->post('rst_sent'),
'COL_GRIDSQUARE' => strtoupper(trim($this->input->post('locator'))),
'COL_VUCC_GRIDS' => strtoupper(preg_replace('/\s+/', '', $this->input->post('vucc_grids'))),
'COL_DISTANCE' => $this->input->post('distance'),
'COL_DISTANCE' => $distance,
'COL_COMMENT' => $this->input->post('comment'),
'COL_NAME' => $this->input->post('name'),
'COL_COUNTRY' => $country,

View File

@@ -246,6 +246,9 @@ function qso_edit(id) {
document.getElementById("distance").value = null;
},
});
} else if ($(this).val().length == 0) {
$('#locator_info').fadeOut("slow");
document.getElementById("distance").value = null;
}
});