add message empty space not allowed

main
alexanderroese 2024-08-13 23:07:55 +02:00
parent 7f817a2530
commit 702cb8f989
1 changed files with 9 additions and 4 deletions

View File

@ -572,15 +572,20 @@
inputLabel.textContent = value.length + ' von ' + maxLength + ' Zeichen verwendet';
// show error message no text specific
if (value.length==0) {
if (value.length == 0) {
inputLabel.textContent = 'Bitte gib deinen Text ein';
inputLabel.style.color = 'red';
}
// show error message no emojis supported on this product variant
if (!emojisSupported && value.length > 0 && emojiRegex.test(value)) {
inputLabel.textContent = 'Emojis werden bei diesem Typ nicht unterstützt. Bitte wechsle zu "Mit Hintergrund"';
inputLabel.style.color = 'red';
if (value.length > 0) {
if (!emojisSupported && emojiRegex.test(value)) {
inputLabel.textContent = 'Emojis werden bei diesem Typ nicht unterstützt. Bitte wechsle zu "Mit Hintergrund"';
inputLabel.style.color = 'red';
} else if (!emojisSupported && text.indexOf(" ") === -1) {
inputLabel.textContent = 'Leerzeichen werden bei diesem Typ nicht unterstützt. Bitte wechsle zu "Mit Hintergrund"';
inputLabel.style.color = 'red';
}
}
}