title: Ajax call after changing the value of a 'option' tag
body: <p>I am facing a little problem using ajax.</p>
  
  <p>I need when I change the value of 'select' tag's 'option' then it will call ajax and the value which I get from the ajax call will show in 'input' tag named 't_name'. But its not working. What the problem in my code?How can I solve it? thank you.</p>
  
  <p>Below is my code :</p>
  
  <pre><code>        &lt;select id="teacher_select" class="teacher_select" name="teacher_select" value="Select Teacher"&gt;
              &lt;option value=""&gt;Select Teacher&lt;/option&gt;
              &lt;?php
              while($row=mysql_fetch_assoc($teacher) ):
              ?&gt;
              &lt;option value="&lt;?php echo $row['t_id'];?&gt;"&gt;&lt;?php echo $row['t_name'];?&gt;&lt;/option&gt;
              &lt;?php 
              endwhile;
              ?&gt;
       &lt;/select&gt;
  
           &lt;input type="text" name="t_credit" id="t_credit"/&gt;
  </code></pre>
  
  <p>Ajax :</p>
  
  <pre><code>     $('#teacher_select').click(function(){
          $.ajax({
          type:'post',
          url:'get_taken_credit.php',
          data: 't_id='+ $('#teacher_select').val(),                
          success: function(reply_data){
              $('#t_credit').html(reply_data);
            }
          });
       });
  </code></pre>
  
  <p>get_taken_credit.php :</p>
  
  <pre><code>         include('db_connection.php'); 
           $t_id = $_POST['t_id'];
           $result = mysql_query("SELECT t_credit FROM teacher WHERE t_id = '$t_id'");
           echo $result;
           exit();    
  </code></pre>