use grid layout for forms
This commit is contained in:
parent
9825b6b951
commit
6ac057bdbf
@ -11,13 +11,9 @@
|
||||
<body>
|
||||
<div class="center-div">
|
||||
<form>
|
||||
<fieldset id="user-configurable">
|
||||
<fieldset>
|
||||
<legend>Change Configuration</legend>
|
||||
<div class="labels-inputs">
|
||||
<div id="labels">
|
||||
</div>
|
||||
<div id="inputs">
|
||||
</div>
|
||||
<div class="labels-inputs" id="user-configurable">
|
||||
</div>
|
||||
<div class="btn-group" id="form-actions">
|
||||
<button id="cancel">CANCEL</button>
|
||||
|
@ -25,10 +25,7 @@ button {
|
||||
}
|
||||
|
||||
.labels-inputs {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: auto auto;
|
||||
column-gap: 10px;
|
||||
}
|
||||
|
||||
.labels-inputs > div {
|
||||
width: max-content;
|
||||
}
|
12
login.html
12
login.html
@ -14,14 +14,10 @@
|
||||
<fieldset>
|
||||
<legend>Proxmox VE Login</legend>
|
||||
<div class="labels-inputs">
|
||||
<div>
|
||||
<div><label for="username">Username:</label></div>
|
||||
<div><label for="username">Password:</label></div>
|
||||
</div>
|
||||
<div>
|
||||
<div><input type="text" id="username" name="username"></div>
|
||||
<div><input type="password" id="password" name="password"></div>
|
||||
</div>
|
||||
<label for="username">Username:</label>
|
||||
<input type="number" min="1" max="10" id="username" name="username">
|
||||
<label for="username">Password:</label>
|
||||
<input type="password" id="password" name="password">
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button id="submit">LOGIN</button>
|
||||
|
@ -19,22 +19,18 @@ async function populateForm (node, type, vmid) {
|
||||
}
|
||||
|
||||
function addFormLine (id, labelName, inputAttr) {
|
||||
let labelWrapperDiv = document.createElement("div");
|
||||
let form = document.querySelector("#user-configurable");
|
||||
|
||||
let label = document.createElement("label");
|
||||
label.for = id;
|
||||
label.innerHTML = labelName;
|
||||
labelWrapperDiv.append(label);
|
||||
let labelContainer = document.querySelector("#labels");
|
||||
labelContainer.append(labelWrapperDiv);
|
||||
form.append(label);
|
||||
|
||||
let inputWrapperDiv = document.createElement("div");
|
||||
let input = document.createElement("input");
|
||||
input.id = id;
|
||||
input.name = id;
|
||||
for (let k in inputAttr) {
|
||||
input.setAttribute(k, inputAttr[k])
|
||||
}
|
||||
inputWrapperDiv.append(input);
|
||||
let inputContainer = document.querySelector("#inputs");
|
||||
inputContainer.append(inputWrapperDiv);
|
||||
form.append(input);
|
||||
}
|
Loading…
Reference in New Issue
Block a user