title: re-enabling the disable button after correcting the entered input
body: <p>i am checking while entering the id wether the id is already exist in the database and if id exist then message displayed 'not available' ,it displays the message, but i want the button to be disable after displaying the message ,and when i clear the id and re-enter the new id then at that moment button should be enabled. please help  </p>
  
  <p>FID is the id of textfield and txtHint is div id of textfield</p>
  
  <p>insert is the id for the button</p>
  
  <pre><code>  $(document).ready(function()
   {
     $("#FID").blur(function()
   {
      //$("#insert").attr("disabled",false);
  
    var rollno = $(this).val();
  
        $.ajax({
  
       type : 'POST',
        url : 'ajaxpage.php',
      data : $(this).serialize(),
       success : function(data)
     {
      $("#txtHint").html(data);   
  
      }
  
      }); }); });
  </code></pre>
  
  <p>ajaxpage.php</p>
  
  <pre><code>      &lt;?php
         require_once 'db.php';
  
            $q=$_POST['FID'];
  
        $stmt = $DBcon-&gt;prepare("SELECT Fid FROM Ftable WHERE Fid LIKE :search ");
            $stmt-&gt;bindValue(':search', '' . $q . '%', PDO::PARAM_INT);
  
             $stmt-&gt;execute();     
              $count=$stmt-&gt;rowCount();
  
            if($count&gt;0)
          {
          echo  'notavailable';
          }
           else
         {
            echo  'available';
          }
  
          ?&gt;
  </code></pre>