Skip to content
Advertisement

Check if TinyMce field contains specific words

I have form and I want to check tiny mce field and prevent users from using some specific words. I get TinyMce field value but I can’t check if tiny_content value contains badwords

My html with TinyMce field

JavaScript

My jQuery

JavaScript

Advertisement

Answer

I use .some method. The some(..) method checks each element of the array against a test function and returns true if any element of the array passes the test function, otherwise, it returns false

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement