jQuery - get the selected options of a listitem collection?
<p>I have fields that a user would enter and i would pass it into jQuery and pass to a web service. </p>

<p>I can get textboxes values by:</p>

<p>var name =  $("#MainContent_txtName").val() </p>

<p>The problem I'm having is a multi-select that comprises of a list item collection. 
If I was to do this server side, I would do something like:</p>

<pre><code>foreach (ListItem li in listTitles)
{
   if (li.Selected)
   {
     selectedValue += li.Value + ",";
   }
}
</code></pre>

<p>And this would give me the string of selected values from the select list.
I'm having trouble getting it out from jQuery. 
If I do </p>

<pre><code>var titles = $("#MainContent_selectListTitles").val() 
</code></pre>

<p>That is obviously incorrect because it won't bring back the selected list items.
I saw a post that suggested that I could retrieve it if I say option selected. 
So I tried this:</p>

<pre><code>var titles= $('#MainContent_selectListTitles option:selected');
</code></pre>

<p>The next thing I did was pop an alert to see what the titles were.  It just said [object, object]. </p>

<p>So my questions are:</p>

<ol>
<li><p>Is it possible to get the selected items from the list item collection concatenated into a string? </p></li>
<li><p>Or is it better that I get all the form values from a postback even on my code behind and then call the jquery function?  If this is an option, i've attempted to do this but have failed.  It tells me that it can't find the method. So i'm definitely not calling the jquery function correctly on postback of the button event.</p></li>
</ol>

<p>THanks.</p>
