title: Check for illegal Characters in any input or text area
body: <p>After help from here where the solution works in the fiddle in the simplest form. But while implementing it, it does not work. So I have added the actual code with the solution given previously. </p>
  
  <p>What I am trying to do is check for illegal characters in any of the input box and text area? Fiddle with actual code is here. <a href="http://jsfiddle.net/19eggs/reQrL/4/" rel="nofollow"><b>Actual Code</b></a></p>
  
  <pre><code>$('.formsubfree').click(function () {
  var str = $(this).prevAll("input, textarea").first().val();
  if (/[%&amp;&lt;&gt;\[\]{}]/.test(str) === true) {
      alert('These characters &amp; &lt; &gt; [ ] { } % are not allowed.  Please remove them and try again.');
  }
  });
  </code></pre>
  
  <p>Earlier Solution with the stripped out html is here  in <a href="http://jsfiddle.net/AR323/7/" rel="nofollow">fiddle </a></p>
  
  <p>Thanks</p>