serialize form selected selectbox option on multiple selectboxes
<p>I have multiple select boxes on the page all of which share the same beginning parts of the name attribute. What I need to do is go through each select box on the page with this starting name <code>SELECT___</code> and grab the name of that select box and whatever the selected option value is and have it formatted like this so that I can then insert it into an Ajax post call as shown below.</p>

<p>Note: the product code is retrieved from the following variable</p>

<pre><code>var global_Current_ProductCode = '100E';
</code></pre>

<p>This is the Ajax call. Notice I hard coded the data field and it works but I need to grab the actually selected options value with its corresponding select name.</p>

<pre><code>$.ajax({
url: $("form[name='MainForm']").attr('action'),
data: "SELECT___100E___7=25&amp;SELECT___100E___9=42&amp;btnupdateprice.x=0&amp;btnupdateprice.y=0&amp;ProductCode=100E",
type: 'POST', 
cache: false,
success: function(response) {
result2= $(response).find(".pricecolor .price");
alert(result2.text());
}
});
</code></pre>

<p>Here is the select boxes. Please note that there could be one, two or more select boxes on the page. Thanks for any help. Hope I am making sense.</p>

<pre><code>&lt;select onChange="change__option(this.name,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text)" name="SELECT___100E___7"&gt;
&lt;option value="0"&gt;Select Cart Color&lt;/option&gt;
&lt;option value="21"&gt;Chrome&lt;/option&gt;
&lt;option value="25"&gt;Beige/Almond [Add $1.00]&lt;/option&gt;
&lt;/select&gt;

&lt;select onChange="change__option(this.name,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text)" name="SELECT___100E___9"&gt;
&lt;option value="0"&gt;Select Cart Color&lt;/option&gt;
&lt;option value="27"&gt;Red&lt;/option&gt;
&lt;option value="42"&gt;Beige/Almond [Add $2.00]&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>So to sum it up I need the format to be like <code>SELECT___100E___7=25&amp;SELECT___100E___9=42&amp;btnupdateprice.x=0&amp;btnupdateprice.y=0&amp;ProductCode=100E</code> so that I can put it in the data field of the Ajax call. This is assuming that the first select box had the beige/Almond option selected (25) and the second select box also had the beige/almond option (42) selected   </p>
