I have a simple input tag in html where users type their names.
How can i make that input not to accept specific words? I am not fan of regex
and i will prefer something more readable if it is possible. Simple javascript or jquery are welcome.
Thanks in advance
You can achieve this by using javascript’s
string.indexOffunction.Here is an example
http://jsfiddle.net/JVrHq/2/
You can extend on this by having an array of disallowed words.