Select box in php not getting the selected value in jQuery
<p>I have a select box like </p>

<pre><code>&lt;select id="addressbook_user" name="addressboook_user"&gt;
   &lt;?php 
      $asql = "SELECT *  from demo_addressbook WHERE user_created_id IN(SELECT id FROM demo_user WHERE user_name = '$get_user_name') AND type = 1 ";                        
      //    $result = mysql_query($query);
      //    mysql_real_escape_string($asql);
      $aresult  = mysql_query($asql) or die (mysql_error());
      while($arow_list=mysql_fetch_assoc($aresult)){
   ?&gt;                       
   &lt;option value="&lt;?php echo $arow_list['guest_name']; ?&gt;"&gt;&lt;?php echo $arow_list['guest_name']; ?&gt;&lt;/option&gt;
   &lt;?php                                    
      }
   ?&gt;
&lt;/select&gt;
</code></pre>

<p>Here is my jQuery code to get this value .</p>

<pre><code>function save() {
    alert($("#addressboook_user").val());
    var selectVal = $('#addressboook_user :selected').val();
    alert(selectVal);
    var user = $("#addressboook_user").val();
}​
</code></pre>

<p>My question is when select box has a selected value then why my jQuery code alert is always showing undefined ?</p>

<p>please help me out here really got frustrated .</p>
