Looping through a table to get dropdown values
<p>i have a table that looks like:</p>

<pre><code>&lt;table id="tblFileUpload" cellpadding="2" cellspacing="2" class="styled"&gt;
    &lt;tr&gt;
        &lt;td align="left"&gt;
            &lt;asp:FileUpload ID="fileUpload1" runat="server" size="50" /&gt;
        &lt;/td&gt;
        &lt;td align="left"&gt;
            &lt;asp:DropDownList ID="ddlRequestType1" runat="server" DataTextField="Value" DataValueField="Key" CssClass="ddl"&gt;&lt;/asp:DropDownList&gt;
        &lt;/td&gt;
        &lt;td align="left"&gt;
            &lt;asp:DropDownList ID="ddlStatusType1" runat="server" DataTextField="Value" DataValueField="Key" CssClass ="ddl2"&gt;
            &lt;/asp:DropDownList&gt;
            &lt;label class="badFileUploadRow"&gt;*&lt;/label&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td align="left"&gt;
            &lt;asp:FileUpload ID="fileUpload2" runat="server" size="50" /&gt;
        &lt;/td&gt;
        &lt;td align="left"&gt;
            &lt;asp:DropDownList ID="ddlRequestType2" runat="server" DataTextField="Value" DataValueField="Key" CssClass="ddl"&gt;&lt;/asp:DropDownList&gt;
        &lt;/td&gt;
        &lt;td align="left"&gt;
            &lt;asp:DropDownList ID="ddlStatusType2" runat="server" DataTextField="Value" DataValueField="Key"&gt;&lt;/asp:DropDownList&gt;
            &lt;label class="badFileUploadRow"&gt;*&lt;/label&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
</code></pre>

<p>It keeps going on and on for another few rows (all named in the same manner)</p>

<p>I should only be able to select 1 status for each request. I need check if a duplicate request types have been selected when any given status type is changed and disable selected statustype of that row.</p>

<p>so for example. if i have selected "save" for both requesttype1 and requestype3, and then selected "some status" in the statustype3, i need to disable "some status" in the same row as requesttype1.</p>

<p>I have the following right now:</p>

<pre><code>$(".ddl2").change(function () {
    var id = $(this).attr('id');
    var cssType = $(this).attr('class');
    var pos0 = id.indexOf('ddlStatusType'); // +14;
    var itemNo = id.substr(pos0);
    var seen = {};
    $('#tblFileUpload td')
        .each(function () {
        //find if multiple request types already exist.
        // if (cssType == "ddl") {
            var txt = $('.ddl :selected').text();
            if (seen[txt]) {//there is a duplicate
                //   $(this).remove();
            }
            else
                seen[txt] = true;
            // }
    });
});
</code></pre>

<p>txt variable returns values of ALL selected values of the request type, not just the one on the same row... i'm stuck. please help.</p>
