Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:55:22+00:00 2026-06-15T19:55:22+00:00

i have a table that looks like: <table id=tblFileUpload cellpadding=2 cellspacing=2 class=styled> <tr> <td

  • 0

i have a table that looks like:

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

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

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.

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.

I have the following right now:

$(".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;
            // }
    });
});

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:55:23+00:00Added an answer on June 15, 2026 at 7:55 pm

    txt variable returns values of ALL selected values of the request type, not just the one on the same row

    Well of course. That’s what $('.ddl :selected') matches: every element with the selected pseudo-class which is a descendant of an element with class ddl. Use a more-specific selector.

    Try changing the inner .each() to this:

    $('#tblFileUpload tr').each(function () {
        var txt = $(this).find('.ddl').val();
        if (seen[txt]) {//there is a duplicate
            //   $(this).remove();
        }
        else seen[txt] = true;
    });
    

    Note, it’s better to use .val() on a <select> than to look for the <option selected> yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that looks like this <table cellpadding=1 cellspacing=0 width=100% border=0> <tr>
I have a table that looks like the following: <table class=theClass> <tr> <td class=anotherClass><strong>Label1:</strong></td>
I have a table that looks like this: <table> <tr> <td class=packing-vol>0.19</td> <td class=qty-cell><input
I have a table that looks like the following: <table class = rota> <thead>
I have a table that looks like this: <table id=table> <thead> <tr class='tablehead'> <th>Test</th>
I have a table that looks like this: id value AGA 0.211 AGA 0.433
I have a table that looks like this: CREATE TABLE foobar ( id SERIAL
I have a table that looks like this: ID (pk,int) Col1 (nvarchar) Col2 (nvarchar)
I have a table that looks like this Id FirstName 5 Adam 6 Bob
I have a table that looks like this: table name: uno str_id | title

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.