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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:58:42+00:00 2026-05-26T10:58:42+00:00

I am rendering a checkbox in a datatable using fnRender, like this. aoColumnDefs:[ {

  • 0

I am rendering a checkbox in a datatable using fnRender, like this.

"aoColumnDefs":[ { 
                   "aTargets": [0],
                   "fnRender": function ( oObj ) {
   return '<input id="chkBox" name="chkBox" value="'+ oObj.aData[0] +'" type="checkbox" checked="" />';
                                                 }
                                              }
                                             ]

Now I would like to toggle the value of the checkbox on click , hence I have written the following function inside the $(document).ready( function() like this

$('.chkBox').change(function() {
                               if($(this).is(':checked')){
                                    alert("checked");
                               } else {
                                   alert("unchecked");
                               }
                            });

But this does not seem to work , and neither does Firebug throw any error. I am unable to follow this.

Can anybody please tell me whether what I am doing is correct or wrong.

Thanks in advance , vivek

  • 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-26T10:58:43+00:00Added an answer on May 26, 2026 at 10:58 am

    have you tried this?

    $('.chkBox').live('click',function() {
         if(this.checked){
             alert("checked");
         } else {
             alert("unchecked");
         }
    });
    

    or

    $('#datatables').delegate('.chkBox','change',function() {
         if(this.checked){
             alert("checked");
         } else {
             alert("unchecked");
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of checkboxes, looking like this: <table> <tr><td><input type=checkbox /> <label>Bla</label></td></tr>
I'd like to change to rendering of the checkboxes. By default, it's this: <dt><label>%name%</label></dt>
I am using Html.CheckBox() . The resulting HTML is: <input id=IsMultiGraph name=IsMultiGraph value=true type=checkbox>
I'm rendering some HTML in a QT QLabel. The HTML looks like this: <pre>foo\tbar</pre>
In my ASP.NET MVC app, I am rendering a checkbox using the following code:
I have a table like this: | Update | Name | Code | modification
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
I would like to have a similar UI rendering as QuickPic android app in
I have a web page that consists of a checkbox (parent) and on this
I am working on rendering a set of cart items using a user control.

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.