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

  • Home
  • SEARCH
  • 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 4116290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:41:23+00:00 2026-05-20T22:41:23+00:00

I am trying to iterate over each text input field and find out whether

  • 0

I am trying to iterate over each text input field and find out whether a checkbox assigned to it is checked or not. I am having trouble selecting checkboxes inside the each() cycle though.

My HTML:

<table>
        <tbody>
                <tr>
                    <td style="vertical-align: top;">
                        <label for="MainTemplate" class="">Hlavná šablóna:</label>
                    </td>
                    <td>
                        <input name="MainTemplate" class="input mainTemplate" value="" style="width: 10em;" type="text"> <br> <table>

    <tbody><tr>         <td>            <input name="MainTemplateInheritCheckbox" class="input inheritCheckbox" value="1" checked="checked" type="checkbox">        </td>       <td style="font-size: 0.9em;">          <label for="MainTemplateInheritCheckbox">hodnoda sa zdedí z vyššej úrovne</label>       </td>   </tr>

</tbody></table>
                        <br>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top;">
                        <label for="Lector" class="">Školiteľ:</label>
                    </td>
                    <td>

                        <input name="Lector" class="input lector" value="" style="width: 10em;" type="text"> <br> <table>   <tbody><tr>         <td>            <input name="LectorInheritCheckbox" class="input inheritCheckbox" value="1" checked="checked" type="checkbox">      </td>       <td style="font-size: 0.9em;">          <label for="LectorInheritCheckbox">hodnoda sa zdedí z vyššej úrovne</label>

        </td>   </tr> </tbody></table>
                        <br>
                    </td>
                </tr>
</table>

My jquery code:

        $("input[type=text]").each(function() {
            // here I need to find out whether the checkbox is checked or not
        });

I tried this but it returns false even for checked checkboxes:

alert($(this).next().next().children("input[type=checkbox]:first").is(":checked"));
  • 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-05-20T22:41:23+00:00Added an answer on May 20, 2026 at 10:41 pm

    Try $(this).next('table').find('input[type=checkbox]:first')is(':checked');

    You could also probably get it by name since they’re related.

    var cbName = '#' + $(this).attr('name') + 'InheritCheckbox';
    $(cbName).is(':checked');
    

    Both of these are a little bit fragile and depend on relationships either in the DOM or between the element names, though I suspect the latter might be more stable over time.

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

Sidebar

Related Questions

I'm trying to iterate over checkboxes in an ASP.Net web page, and if any
I'm trying to use jQuery Button to build a button bar for each item
I'm trying, for reasons best known to my unconscious mind, to generate a snow-crash-like
I am trying to create a code coverage tool using Delphi 2007. My general
I'm just building my first MVC application and hitting a problem trying to perform
I have a MySQL database containing these tables: sessions -------- sessionid (INT) [courseid (INT)]
I would like to call a Python script from within a Bash while loop.
I'm scraping a page with Python's pyquery, and I'm kinda confused by the types
I've looked at formset and model formset at Django many times, but I still
String processing in C# and VB.NET is easy for me, but understanding how to

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.