I want to know if a richTextBox has had code entered into it or not.
If i do $w(“richTextBox”).value I get “
” but this will not register in an if statement.
I cannot do it by length of value as if the input is one character long it will have the same length as if it were empty.
You could do this variable assignment all in one line, but for sake of readability when posted, it was done with two variables and two lines.
let richText = $w("richTextBox").value.replace("<p>","");
let richText2 = richText.replace("</p>","").trim();
if (richText2.length === 0){
console.log("it's empty");
}
That seams to work, thank you.