@nickoertel also if the user writes a character that is encoded to a special html entity such as apostrophe, #, &, “greater than” symbol etc… you’ll need identify it and count them as 1 character even though they are longer in html.
before you count, otherwise the number will be greater then it should be.
@nickoertel I guess you meant it doesn’t trigger when you paste it using mouse clicks (not via ctrl+v).
So I think there’re 2 solutions -
If you have a premium account you can create your onw rich-text box using custom element and add oninput event listener (it depends if you know how to use custom elements/or if you want to learn it).
You can use Wix rich-text, and use texbox.onFocus() to setInterval() to check (let’s say every 100ms) if the value has changed. and texbox.onBlur() to clearInterval() .
@nickoertel basically there’s an onInput event on Corvid but it looks like it doesn’t work for rich-text (it’s probably a bug) . So the 2 solutions I mentioned above are what you have,
@jonatandor35 Thanks for your help. Maybe Wix should work on the richtextboxes and make it user easier to work with them.
I have a code, that works now, but I still have one more question.
How can I border the box red ?
.required = true doesn’t work and . borderColor doesn’t work, too.
Maybe with some html ?
@jonatandor35 Can confirm, just ran into this issue and found this post a year later. The value parameter is always undefined when triggered. As a workaround, using $w.RichTextBox.value to access it works, though.
Also somewhat related: the built-in “required” check appears to fail for the same reason that the OP mentioned. I’m currently doing something similar to @jonatandor35 's solution to strip out the HTML tags and spaces to check if it’s really empty.