reference another dropdown value from js method call
<p>I am trying to pass in values from another dropdown (ddlColor) and pass it's selected id and text value into the event method for ddlEngine</p>

<pre><code>&lt;asp:DropDownList ID="ddlEngine" runat="server" onchange="GetSearchResults(ddlColor.value, ddlColor.text, this.options[selectedIndex].text);" /&gt;
</code></pre>

<p>I guess I can't reference the ddlColor like this, something is not right in my syntax and I can't see what.</p>

<p>Here is my attempt:</p>

<p>this is defined globally at the top of my page just after the js tag:</p>

<pre><code>var ddlColor = document.getElementById('&lt;%=ddlColor.ClientID %&gt;');

var colorid_dropdown = ddlColor.options[ddlColor.selectedIndex].value;
var colorname_dropdown = ddlColor.options[ddlColor.selectedIndex].text;
</code></pre>

<p>then in teh onchange of my dropdown I tried to append it to the call:</p>

<pre><code>onchange="GetSearchResults("' + colorid_dropdown + ", " + "'colorname_dropdown + '" + ", this.options[selectedIndex].text);" 
</code></pre>
