fix: [html] <option> tag wants to be inside <select> tag

This commit is contained in:
Steve Clement 2024-09-01 12:43:46 +02:00
parent 01323c6c65
commit c1d4f7c60a

View file

@ -15,7 +15,7 @@ function createHTML(addr, i) {
}
// Needs option to use value in js
let name = `<option id="name${addr.ID}" value="${addr.Name}">${addr.Name}</option>`;
let name = `<select><option id="name${addr.ID}" value="${addr.Name}">${addr.Name}</option></select>`;
if (edit == 1) {
name = `<input id="name${addr.ID}" onchange="editForm(${addr.ID},'')" type="text" class="form-control" value="${addr.Name}">`;
}
@ -85,4 +85,4 @@ async function editForm(id, known) {
// console.log(url);
await fetch(url);
}
}