title: how to allow only keyboard characters while submitting a form using jquery
body: <p>how to validate the text field while submitting the form using jquery to display an alert message if the text field contains other than keyboard special characters like ascii characters form 127-255 and iso-8859-1 caharacters</p>
  
  <p><strong>Sample Code :</strong></p>
  
  <p><strong>Javascript Code :</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function()
      {           
          $('#send').click(function()
          {
              var firstname=$('#firstname').val();
              var pattern = "^[a-zA-Z0-9~`!@#$%^&amp;*()_+-={}|:;&lt;&gt;,.?\/']+$";
              if((!firstname.match(pattern)))
              {
                  alert('your input contained not supported characters');
                  return false;
              }
              return true;
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Html Code :</strong></p>
  
  <pre><code>&lt;form id="ajax_form" action="ajaxoutput.php"&gt;
  &lt;input type="text" name="FirstName" id="firstname" placeholder="FirstName" /&gt;&lt;br&gt;
  &lt;input type="text" name="LastName" placeholder="LastName" /&gt;&lt;br&gt;
  &lt;input type="file" name="image"/&gt;&lt;br/&gt;
  &lt;input type="submit" value="submit" name="submit" id="send" /&gt; &lt;input type="reset" value="reset"/&gt;
  &lt;/form&gt;
  </code></pre>