mirror of
https://github.com/30hours/3lips.git
synced 2025-02-16 14:07:09 +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 {
|
} else {
|
||||||
button.classList.add("btn-secondary");
|
button.classList.add("btn-secondary");
|
||||||
button.classList.remove("btn-success");
|
button.classList.remove("btn-success");
|
||||||
}
|
|
||||||
|
|
||||||
// Set the value to server.url when the button is pressed
|
// Remove the corresponding hidden input when the button is deselected
|
||||||
var serverUrl = button.getAttribute('value');
|
var serverUrl = button.getAttribute('value');
|
||||||
button.value = pressed === 'true' ? serverUrl : '';
|
var hiddenInputs = document.querySelectorAll('input[name="url"][value="' + serverUrl + '"]');
|
||||||
console.log(button.value);
|
hiddenInputs.forEach(function (input) {
|
||||||
}
|
input.parentNode.removeChild(input);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue