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 632451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:04:40+00:00 2026-05-13T20:04:40+00:00

I have a generated table that contains multiple rows with each row containing a

  • 0

I have a generated table that contains multiple rows with each row containing a leading td with a checkbox and another td with a select list =

<div class="table">
<table width="100%" class="tframe" id="table0">
<thead>
<tr class="trheadline">
    <th>Selection</th>
    <th>Repository-Tag</th>
</tr>
</thead>
<tbody>
<tr class="trow">
    <td>
        <input type="checkbox"
          value="0#298#abk_testn#l#CLEARCASE#at_web_vob"
          name="module">ModuleA
    </td>
    <td>
    <select name="cvstags">
        <option value="no_Repository">no_Repository</option>
        <option value="220607_143102110">220607_143102110</option>
        <option value="220607_09410236">220607_09410236</option>
        <option value="220507_091903814">220507_091903814</option>
    </select>
    </td>
</tr>
<tr class="trow">
    <td>
        <input type="checkbox"
          value="1#299#abk_integration#d#CLEARCASE#at_web_vob"
          name="module">ModuleB
    </td>
    <td>
    <select name="cvstags">
        <option value="220607_143102110">220607_143102110</option>
     </select>
    </td>
 </tr>
 <tr class="trow">
     <td>
        <input type="checkbox"
          value="2#301#abk_statcont##CLEARCASE#at_web_vob"
          name="module">ModuleC
    </td>
    <td>
    <select name="cvstags">
        <option value="no_Repository">no_Repository</option>
        <option value="220607_143102110">220607_143102110</option>
        <option value="220607_09410236">220607_09410236</option>
        <option value="220507_091903814">220507_091903814</option>
    </select>
        </td>
    </tr>
    </tbody>
 </table>
</div>

Now I want to pin a change event upon the select, but I want an action only to get started, if the leading checkbox is checked, for now I have =

<script>
    $('select').change(function(){
        alert($(this).val());
    });
</script>

which gives me the value of the selected option, fine but two problem remain =

  1. how to check whether the leading checkbox in the same tr is checked ?

    $('select').change(function(){
     if (the leading checkbox is checked) {
        run my action..
     }
    });
    
  2. the change event doesn’t work if the select list has only
    one option as in the second row of my example above, how
    to achieve a similar behaviour as with change event for that case ?

Thanks for any hints !!

  • 1 1 Answer
  • 1 View
  • 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-05-13T20:04:41+00:00Added an answer on May 13, 2026 at 8:04 pm

    How about looking at this the other way around i.e. handle the click event on the checkbox and if checked, assess the value of the select in the row?

    $('tr.trow input:checkbox').click(function() {
        if (this.checked) {
            var self = $(this);
            self.parent().parent().find('select').val(); // value of select
        }
    }
    

    EDIT:

    Here’s how I would roughly handle it:

    // use an object literal to prevent global pollution(!)
    var rowActions = {
        checkbox: function() {
           if (this.checked) {
               rowActions.doSomething();
           }
        },
        select: function() {
           if ($(this).parent().parent().find('input:checkbox:checked').length) {
               rowActions.doSomething();
           }
        },
        doSomething: function() {
            alert('I did something!');
        }
    }
    
    $('tr.trow').each(function() {
        var self = $(this);
        self.find('input:checkbox').click(rowActions.checkbox);
        self.find('select').change(rowActions.select);
    });
    

    and here’s a Working Demo to show it in action. add /edit to the url to play with the code.

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

Sidebar

Ask A Question

Stats

  • Questions 377k
  • Answers 377k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I create a keychain for each team, and put all… May 14, 2026 at 9:02 pm
  • Editorial Team
    Editorial Team added an answer I think Perligata (Perl in Latin) is what you're looking… May 14, 2026 at 9:02 pm
  • Editorial Team
    Editorial Team added an answer http://www.google.com/support/youtube/bin/answer.py?hl=en&answer=56107 Yes, you can autoplay movies! In the "About This… May 14, 2026 at 9:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.