title: Check duplicate user name with client-side validation
body: <p>I have a one input type and button, which are used to enter username into the SQL database via ajax. </p>
  
  <p>Now I want to achieve the <strong>validation</strong> that checks the duplicate names. If duplicate exists an error message will be shown, any help regarding this</p>
  
  <pre><code>&lt;div id="Div1"&gt;
      &lt;label&gt;FormName&lt;/label&gt;
      &lt;input type="text" id="Text1" placeholder="Type form name here" class="form-control" /&gt;
  &lt;/div&gt;
  &lt;div id="Div2" style="float: right;"&gt;
      &lt;input type="button" id="Button2" class="btn btn-default" style="" value="Save Form" /&gt;
      &lt;input type="button" id="Button3" class="btn btn-success" style="" value="Add Section" /&gt;
  &lt;/div&gt;
  </code></pre>