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

@ -578,9 +578,14 @@
}
// show error message no emojis supported on this product variant
if (!emojisSupported && value.length > 0 && emojiRegex.test(value)) {
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';
}
}
}