Check input of a text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • caveman
    New Member
    • Feb 2007
    • 6

    Check input of a text box

    Hiya,

    Is there anyway you can check the input of a text box? For example if you had a textbox which submits articles to the site and you want to make sure you dont get any rude language... Is there such a script?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I assume that you mean a textarea. You can use regular expressions to parse the text and search for rude words.

    Use the RegExp object (regular expressions), e.g. the regular expression
    Code:
    (rude|naughty)
    would match either "rude" or "naughty" in the text.

    Comment

    Working...