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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:31:15+00:00 2026-06-03T22:31:15+00:00

I have a reservation form that lists classes, with radio buttons, for reserving a

  • 0

I have a reservation form that lists classes, with radio buttons, for reserving a class. If the class is full, a waitlist checkbox appears on the row with the class’s radio button. In jQuery, if a full class radio button is clicked, I want jQuery to check the waitlist checkbox. The td class=”wailist” will be in every row, but the checkbox will only be in the HTML if the class is full.
My jQuery so far-

var $class_table = JQuery('table.courses');
$class_table.find('input.radio').click(function (event)
{
   //if this row has a td.waitlist with a checkbox in it then check that box
 });

Here is the HTML snippet:

<tr class="course_full">
<td class="course_select", colspan=2>
    <label>
        <input type="radio" name="course[1][1]"
                id="course_id_1_9"
               value="9"
                >
        Geometry 2                                              
    </label>
</td>                                       
<td class="credit_recovery"> 
    <label>
        <input type="checkbox" name="credit_recovery[1][9]"
                id="credit_recovery_id_1_9"
                >
    </label>
</td> 
<td class="waitlist">
        <label>
            <input type="checkbox" name="waitlist[1][9]"
                    id="waitlist_id_1_9"
                    >
        </label>
</td>

I’ve failed at every ‘this’ ‘closest’ ‘find’ etc. Maybe length needs to be involved?

  • 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-03T22:31:16+00:00Added an answer on June 3, 2026 at 10:31 pm

    Is the click event working? If it’s not, I’d suggest the :radio selector:

    $class_table.find(":radio").click(function(event) {
    

    If it is, then the next step is to locate your checkbox relative to the found radio. You can simply use parent as @Imdad suggested (or several calls to parent) or, alternatively, closest. Inside your callback:

    $(this).closest('tr').find('.waitlist :checkbox').attr('checked', true);
    

    It will locate the parent row (no matter how deeply nested your radio button is) and then search for a checkbox inside the column with class waitlist. The last call will only have any effect if the result of find is non-empty. Working example at jsFiddle

    If you prefer to be explicit when navigating the structure, you can locate the correct column with 2 calls to parent and one to siblings, according to your HTML snippet:

    $(this)
       .parent().parent().siblings('.waitlist')
       .find(':checkbox').attr('checked', true);
    

    Working example here, should produce the same results as the first one.

    (Note: cleaned up the answer, correct contents preserved)

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

Sidebar

Related Questions

I have a flight reservation program use mssql ,For reserving flights i want to
I have a Reservation model that I'm searching for with three fields. The container_id
I'm working with a domain model, in which I have a Reservation class: class
i have a form that has select element <select name=adddisplaypage[] id=adddisplaypage multiple=multiple> <option value=all
so..I have a form with method='post' set. <form action='/${languageLinkCode}html/reservation' method='POST' name='homeform'> //fields <button>Submit</button> </form>
I have a table that references a reservation and a product, but I can't
I have an instance of NSNumber * did inside a class called Reservation. Below
I am developing a reservation system, and i have a function that save the
I have a reservation form with input checks. If there is something filled in
I have a reservation system that allows you to Book a reservation, Modify an

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.