Use new error handling in DeleteCollectionScene

This commit is contained in:
Max Berger
2026-03-09 23:40:41 +01:00
parent 6d7396395f
commit 55529f3031
2 changed files with 32 additions and 17 deletions

View File

@@ -115,5 +115,19 @@ export function validate_color(input, field_name) {
}
return null;
};
}/**
* Validates that the input matches a specific string.
* @param {HTMLInputElement} input
* @param {string} target
* @param {string} field_name
* @returns {function(): ?string}
*/
export function validate_equals(input, target, field_name) {
return () => {
let value = input.value;
if (value === target) {
return null;
}
return "Please type " + target + " in the " + field_name + " field";
};
}