add message for emojis not supported on this type
parent
7edb3de769
commit
e4db478496
|
@ -554,7 +554,7 @@
|
|||
|
||||
function SHX_IFC_genTextInput(inputID, labelText, inputName, inputVal, section_id, maxLength = 24, emojisSupported = false) {
|
||||
// helper function to check if string contains emoji on product variant which not support emojis
|
||||
function showErrorMessageIfEmojiNotSupported(value) {
|
||||
function showErrorMessageIfEmojiNotSupported(value, inputID) {
|
||||
if (!emojisSupported && value.length > 0 && emojiRegex.test(value)) {
|
||||
console.log("here", value, "doc", document.querySelector(`label[for="${inputID}-label"] span`))
|
||||
|
||||
|
@ -564,7 +564,7 @@
|
|||
}
|
||||
|
||||
setTimeout(() => {
|
||||
showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value)
|
||||
showErrorMessageIfEmojiNotSupported(document.querySelector(`#${inputID}`).value, inputID)
|
||||
|
||||
document.querySelector(`#${inputID}`).addEventListener('input', (e)=>{
|
||||
if (!document.querySelector(`label[for="${inputID}-label"] span`)) {
|
||||
|
@ -580,7 +580,7 @@
|
|||
document.querySelector(`label[for="${inputID}-label"] span`).style.color = 'red';
|
||||
}
|
||||
|
||||
showErrorMessageIfEmojiNotSupported(e.target.value)
|
||||
showErrorMessageIfEmojiNotSupported(e.target.value, inputID)
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
|
|
Loading…
Reference in New Issue