This JavaScript is a "Word Filter". It is a type of form validator. When the user submits some text, the validator will check the text for words that has to be filtered.
The words that have to be filtered must be added to the array swear_words_arr. When the user types the text and hits the submit button, if the text contains any word that is present in the array swear_words_arr, the form will not be submitted.
Place the <script> in the <HEAD> section of your page.
In this version, you can validate multiple form fields. View the source and see the section marked <--BEGIN FORM-->
The script can be used for validation of swear words etc. |
|