Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Jenny Lane
Jenny Lane
6,468 Points

I need a script to prevent users from entering bad words upon form submission.

Do I need to list out every bad word that I can think of, or is there a library out there somewhere? I have been on stackoverflow other sites researching but have not found a great way to do this without coming up with my own library of words. Any ideas?

1 Answer

Hey Jenny,

There's not an algorithm for deciding if a word is "bad," if that's what you're asking. But there is this library that seems like it's in the ballpark of what you're looking for. The actual list of words are here.

Edit

There's also this API

Jenny Lane
Jenny Lane
6,468 Points

That sounds like exactly what I am looking for! Thanks, ill check it out!