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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:51:39+00:00 2026-05-23T21:51:39+00:00

Trying to set a checkbox inside a table. I thought it would be straightforward

  • 0

Trying to set a checkbox inside a table. I thought it would be straightforward and similar to doing it in a form.

I can do this successfully with a form , but getting stuck when the checkbox is in a table.

When the checkbox is in a form I use:

 <form name="access_menu_form">
    <input type="checkbox" name="mybox_name" id="mybox_id" value="1">
 </form>

 document.access_menu_form.mybox_name.checked == true

Which works great!!

I know I am missing a key point about the DOM. Trying to set a checkbox that I have in table fails using a similar technique which fails:

My table:

 <table name="access_table">
   <thead>
    <tr>
      <th>Area</th> 
      <th>Item</th> 
      <th>Access</th> 
    </tr>
  </thead>
 <tr>
   <td><input type="checkbox" name="mybox_name" id="mybox_id" value="1"></td>
   <td><input type="checkbox" name="mybox1_name" id="mybox1_id" value="1"></td>
   <td></td>
 </tr>
 </table>

My script

 document.access_table.mybox_name.checked = false;

I get the error: Uncaught TypeError: Cannot read property ‘mybox’ of undefined

 document.mybox_name.checked = false;

I get the error: Uncaught TypeError: Cannot set property ‘checked’ of undefined

  • 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-23T21:51:39+00:00Added an answer on May 23, 2026 at 9:51 pm
    • Use the ‘checked’ attribute
    • let javascript find the checkbox using the following, document.getElementById(‘mybox_id’)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying set the single table inheritance model type in a form. So i
I am trying to make a table inside a table so I can organize
I am trying to set backgroundColor of CheckBox by code. Its not working on
I'm working with a custom checkbox, and I'm trying to set the content to
I'm trying to check a set of divs with id='checkbox-selector-chosen' to see if a
I'm trying to enlarge the checkboxes I've placed inside of a table. width:###px; height:###px;
I am trying to set a BOOL to a key in NSUserDefaults, but it
The following code does work in FF. I am trying to set the checkbox
I am trying to use JQuery to set a checkbox to checked if the
I am trying to set the disabled property for my CheckBox to true. However,

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.