title: ajax: not getting value
body: <p>i'm not getting company_name value to show_house_members.php.
  but event_name can get over there. is there any error in this ajax code? i'm just a beginner in this.</p>
  
  <pre><code> $(document).ready(function() {
      $("#add_mem").click(function() {
      $(this).after('&lt;div class="loader1"&gt;&lt;img src="imgdropdown/loading.gif" alt="loading subcategory" /&gt;&lt;/div&gt;');
  
      var datastring = "&amp;company_name="+$('#company_name').val()+"&amp;event_name="+$('#event_name').val();
  
      $.ajax({
          url: 'show_house_members.php',
          data: datastring,
          type: 'get',
          success: function(data) {
              console.log(data);
              $('.loader1').hide();
              $("#house_members").after(data);
          }
      });
  });
          });
  </code></pre>
  
  <p>and here is my form</p>
  
  <pre><code>&lt;p&gt;&lt;label&gt;company name&lt;/label&gt;
                  &lt;select name="company_name" id="company_name"&gt;
  
  
  
  
                  &lt;?php
                  include("config/dbconfig.php");
                                       $res=mysql_query("select *from tbl_company");
                                          while($row=mysql_fetch_array($res))
                                      {
                                          echo "&lt;option value=".$row[0]."&gt;".$row[1]."&lt;/option&gt;";
                                      }
  
                  ?&gt;
                  &lt;/select&gt;&lt;/p&gt;
  
  
                  &lt;!--event names dynamically added here by using jquery ajax --&gt;             
                  &lt;p&gt;&lt;label&gt;Event name&lt;/label&gt;
                  &lt;select name="event_name" id="event_name"&gt;
                  &lt;/select&gt;&lt;/p&gt; 
  
                  &lt;a href="#"  id="add_mem"  name="add_mem" style="padding-left: 280px;" "&gt;&lt;img title='add_house_members'  src='images/button.png'/&gt;&lt;/a&gt;&lt;form action="add_house_entry.php" method="GET|POST"  enctype="multipart/form-data"  name="f3" class="smart-green" style="width: 450px;   height:290px;padding-top: 50px;padding-left: 20px;" &gt;
                  &lt;h1&gt;Enter House details  &lt;/h1&gt;
  </code></pre>