Check if new table columns and rows are not empty

This commit is contained in:
blankie 2023-10-23 14:53:48 +11:00
parent 7ba6b9f6ad
commit a1673f0805
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 10 additions and 0 deletions

View File

@ -124,6 +124,16 @@ function reloadTable() {
createDialog.addEventListener("input", function(event) {
if (event.target.value === "") {
event.target.setCustomValidity("Please enter a value");
} else {
event.target.setCustomValidity("");
}
event.target.checkValidity();
});
createDialog.addEventListener("submit", function() { createDialog.addEventListener("submit", function() {
let columns = createDialog.querySelector("#cols").valueAsNumber; let columns = createDialog.querySelector("#cols").valueAsNumber;
let rows = createDialog.querySelector("#rows").valueAsNumber; let rows = createDialog.querySelector("#rows").valueAsNumber;