From 702cb8f9899440820107be22f57c80dba760bb9a Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Tue, 13 Aug 2024 23:07:55 +0200 Subject: [PATCH] add message empty space not allowed --- snippets/shx-3d-render-input.liquid | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/snippets/shx-3d-render-input.liquid b/snippets/shx-3d-render-input.liquid index 76aea8f..b5c4c94 100644 --- a/snippets/shx-3d-render-input.liquid +++ b/snippets/shx-3d-render-input.liquid @@ -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'; + } } }