title: Validate input value against blacklist array
body: <p>I'm currently using <a href="https://jqueryvalidation.org/" rel="nofollow">jQuery Validation</a>, I have a form with four input fields - Word, Country, Age &amp; Sex.</p>
  
  <p>Country, Age &amp; Sex validate without any problems, but Word doesn't want to validate - I'm trying to get the Word value to check its self against a blacklist before validating, I'm trying to prevent users submitting offensive words.</p>
  
  <p>At the moment, whatever word I type into the Word input field, it always shows as an error and doesn't want to validate. </p>
  
  <p>If anyone can see where I'm going wrong, I'd appreciate the help!</p>
  
  <p><a href="http://i.stack.imgur.com/DznoX.png" rel="nofollow">Screenshot</a></p>
  
  <p>JS</p>
  
  <pre><code> /* Blacklist Array */
      var blacklist = ['foo', 'bar', 'fizz', 'buzz', /* many more banned words... */ ];
  
      /* Blacklist Validation */
      jQuery.validator.addMethod("word", function(value) {
        var in_array = $.inArray(value, blacklist);
        if (in_array == -1) {
          return false;
        } else {
          return true;
        }
      });
  
      /* Submit Validation */
      $("#submit").validate({
        errorPlacement: function(error, element){},
        rules: {
          word: {
            required: true
          },
          country: {
            required: true
          },
          age: {
            required: true
          },
          sex: {
            required: true
          }
        },
        submitHandler: function(form) {
          alert('Submitted');
        }
      });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>  &lt;form methord="post" name="wordsubmit" id="submit"&gt;
      &lt;div class="inner"&gt;
        &lt;input class="word" name="word" placeholder="Your Word" type="text"/&gt;
        &lt;select class="country" name="country" size='1'&gt;
          &lt;option value=""&gt;Your country&lt;/option&gt;
        &lt;/select&gt;
        &lt;select class="age" name="age" size='1'&gt;
          &lt;option value=""&gt;Age&lt;/option&gt;
          &lt;option value="18-24"&gt;18-24&lt;/option&gt;
          &lt;option value="25-34"&gt;25-34&lt;/option&gt;
          &lt;option value="35+"&gt;35+&lt;/option&gt;
        &lt;/select&gt;
        &lt;select class="sex" name="sex" size='1'&gt;
          &lt;option value=""&gt;Sex&lt;/option&gt;
          &lt;option value="Male"&gt;Male&lt;/option&gt;
          &lt;option vlaue="Female"&gt;Female&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;input class="submit" name="submit" type="submit" value="Submit"/&gt;
    &lt;/form&gt;
  </code></pre>