mirror of
https://github.com/30hours/3lips.git
synced 2024-11-18 12:33:58 +00:00
Fix selected server value
This commit is contained in:
parent
969c031ca2
commit
0e3b746e2f
1 changed files with 8 additions and 6 deletions
|
@ -10,10 +10,12 @@ function toggle_button(button) {
|
|||
} else {
|
||||
button.classList.add("btn-secondary");
|
||||
button.classList.remove("btn-success");
|
||||
}
|
||||
|
||||
// Set the value to server.url when the button is pressed
|
||||
var serverUrl = button.getAttribute('value');
|
||||
button.value = pressed === 'true' ? serverUrl : '';
|
||||
console.log(button.value);
|
||||
}
|
||||
// Remove the corresponding hidden input when the button is deselected
|
||||
var serverUrl = button.getAttribute('value');
|
||||
var hiddenInputs = document.querySelectorAll('input[name="url"][value="' + serverUrl + '"]');
|
||||
hiddenInputs.forEach(function (input) {
|
||||
input.parentNode.removeChild(input);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue