title: custom jquery validation and unobtrusive JavaScript
body: <p>I'm trying to write a custom validation that gives an error if html exists in the textarea when they submit a form.</p>
  
  <p>I have the following - 
  its not working and I'm not sure why.</p>
  
  <p>also I don't understand the unobtrusive part 
  can someone show me how to do that as I am seeing other examples on SO that have it.  </p>
  
  <p>text area has a class"note"
  the form is called "noteform"</p>
  
  <pre><code>  &lt;script type="text/javascript" &gt;
          $(document).ready(function () {
  
  
          $.validator.addMethod('nohtml', function (value, element) {
              var text = $(".note").text();
              if ($(text).length &gt; 0) {
                  return false;
              }
              else {
                  return true;
              }
          }, 'Html not allowed');
  
      //    // **not sure what to do here**
      //    $.validator.unobtrusive.adapters.add('containsnohtml', {}, function (options) {
      //        options.rules['nohtml'] = false;
      //        options.messages['nohtml'] = options.message;
      //    });
  
          $('#noteform').validate({
              rules: { nohtml: "required nohtml" }
          });
  
      });
  
  &lt;/script&gt;
  </code></pre>