remote_instance_actions/install_form.js

23 lines
787 B
JavaScript

// Convert each line of the textarea to a unique input element, so they're all passed with separate GET parameters
function updateForm() {
form = document.getElementById("install-form");
instances = document.getElementById("instance-input").value.split("\n");
for (const instance of instances) {
let input = document.createElement("input");
input.type = "hidden";
input.name = "instances[]";
input.value = instance;
form.appendChild(input);
}
}
function faqHighlight() {
document.getElementById("whyform").style.backgroundColor = "#ffffee";
}
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("install-button").addEventListener("click", updateForm);
document.getElementById("whyformlink").addEventListener("click", faqHighlight);
});