Show correct callsign left of dropdown menu

pull/2635/head
phl0 2023-10-29 02:43:22 +02:00
rodzic adb8e8d03c
commit 90a0529203
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -66,7 +66,7 @@
<tbody>
<?php
foreach ($calls_wo_sid as $call) {
echo '<tr><td>'.$call['COL_STATION_CALLSIGN'].'</td><td><select name="station_profile" id="station_profile">';
echo '<tr><td><div id="station_call">'.$call['COL_STATION_CALLSIGN'].'</div></td><td><select name="station_profile" id="station_profile" onChange="updateCallsign(this)">';
$options='';
foreach ($stations->result() as $station) {
$options.='<option value='.$station->station_id.'>'.$station->station_profile_name.' ('.$station->station_callsign.')</option>';

Wyświetl plik

@ -35,3 +35,9 @@ function toggleAll(source) {
source.checked = false;
}
}
function updateCallsign(item) {
let text = item.options[item.selectedIndex].text
let call = text.substr(text.lastIndexOf('(')+1,(text.lastIndexOf(')')-text.lastIndexOf('(')-1));
document.getElementById("station_call").innerHTML = call;
}