Input types of tc edit modified

This commit is contained in:
Kai Lauterbach 2023-05-05 11:07:56 +02:00
parent 840443e46e
commit 402b63d680
2 changed files with 32 additions and 20 deletions

View file

@ -230,11 +230,14 @@ table.appendChild(headerRow);
for (var row = 0; row < 10; row++) {
var contentRow = document.createElement("tr");
var hourCell = document.createElement("td");
var hourInput = document.createElement("input");
hourInput.type = "number";
hourInput.min = 0;
hourInput.max = 23;
hourCell.appendChild(hourInput);
var hourSelect = document.createElement("select");
for (var hour = 0; hour <= 23; hour++) {
var option = document.createElement("option");
option.value = hour;
option.text = hour.toString().padStart(2, "0");
hourSelect.appendChild(option);
}
hourCell.appendChild(hourSelect);
contentRow.appendChild(hourCell);
var minuteCell = document.createElement("td");
var minuteSelect = document.createElement("select");
@ -248,11 +251,14 @@ minuteCell.appendChild(minuteSelect);
contentRow.appendChild(minuteCell);
for (var channel = 1; channel <= 4; channel++) {
var channelCell = document.createElement("td");
var channelInput = document.createElement("input");
channelInput.type = "number";
channelInput.min = 0;
channelInput.max = 100;
channelCell.appendChild(channelInput);
var channelSelect = document.createElement("select");
for (var i = 0; i <= 100; i++) {
var option = document.createElement("option");
option.value = i;
option.text = i.toString();
channelSelect.appendChild(option);
}
channelCell.appendChild(channelSelect);
contentRow.appendChild(channelCell);
}
table.appendChild(contentRow);

View file

@ -279,11 +279,14 @@ function createTable() {
// Spalte "Stunde"
var hourCell = document.createElement("td");
var hourInput = document.createElement("input");
hourInput.type = "number";
hourInput.min = 0;
hourInput.max = 23;
hourCell.appendChild(hourInput);
var hourSelect = document.createElement("select");
for (var hour = 0; hour <= 23; hour++) {
var option = document.createElement("option");
option.value = hour;
option.text = hour.toString().padStart(2, "0");
hourSelect.appendChild(option);
}
hourCell.appendChild(hourSelect);
contentRow.appendChild(hourCell);
// Spalte "Minute"
@ -301,11 +304,14 @@ function createTable() {
// Spalten "ch1" bis "ch4"
for (var channel = 1; channel <= 4; channel++) {
var channelCell = document.createElement("td");
var channelInput = document.createElement("input");
channelInput.type = "number";
channelInput.min = 0;
channelInput.max = 100;
channelCell.appendChild(channelInput);
var channelSelect = document.createElement("select");
for (var i = 0; i <= 100; i++) {
var option = document.createElement("option");
option.value = i;
option.text = i.toString();
channelSelect.appendChild(option);
}
channelCell.appendChild(channelSelect);
contentRow.appendChild(channelCell);
}