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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:02:55+00:00 2026-06-13T02:02:55+00:00

I have an jQuery dialog box, containing table with multiple checkboxes. $(#custom-modal).dialog({ height: 200,

  • 0

I have an jQuery dialog box, containing table with multiple checkboxes.

$("#custom-modal").dialog({
            height: 200,
            modal: true,
            buttons: { "OK": function () {
                var table1 = $("#MainContent_rtc1_customTable").html();
                alert(table1);
                //$.session('mytbl', $("#customTable").val());
                $.ajax({
                    type: "POST",
                    url: "MyPage.aspx/BindCustom",
                    data: ({ param1: table1 }),
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        alert(errorThrown);
                    },
                    success: function (result) {
                        alert("success");
                    }
                });

                $(this).dialog("close");
                return true;
            }, "Cancel": function () {
                $(this).dialog("close");
                return false;
            }
            }

        });
    });

    $(':checkbox').click(function () {
        var $this = $(this);
        if ($this.is(':checked')) {
            //alert(event.target.id);
            $this.attr('checked', false);
        } else {
            //alert(event.target.id);
            $this.attr('checked', true);
        }
    });

After changing states of checkboxes, When I see html code of the table with alert(table1); (after pressing OK button); I see states of all the checkboxes as checked. So they don’t gets changed.?

  • 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-13T02:02:56+00:00Added an answer on June 13, 2026 at 2:02 am

    If they are ASP check boxes then the actual check box input is not the control. besides that it would appear you are not properly binding the event, which as mentioned by wirey, is not needed if you are just trying to change the checked property.

    Refer to this post if you still need to add an event handler to the check boxes:

    Need to select all checkboxes and dynamically add specific event handler to each

    The issue is was reported as a bug but then decalred not valid and not fixed (http://bugs.jquery.com/ticket/7594).

    One thing that you could do is to handle the click event correctly and then set a custom variable that could be checked. In asp this would be difficult to check because the check boxes are not just inputs, they come packaged with a span and all classes and attributes are usually added to the span, not the box.

    So depending on your needs you could do the following:

    var table1;
    
    $('.isCheckBox').each(function(){
        //default value set here
        $(this).attr('isChecked','false');
    });
    
    $('input:checkbox').click(function (event) {
        if($(this).prop('checked') == true)
        {
           $(this).attr('data-isChecked','true'); 
        }
        else
        {
            $(this).attr('data-isChecked','false'); 
        }
    
        table1 = $('#thetable').html();
        alert(table1);
    });
    

    with HTML of:

    <table id="thetable">
    <tr>
        <td><input class='isCheckBox' type="checkbox"/></td>
        <td><input class='isCheckBox' type="checkbox"/></td>
        <td><input class='isCheckBox' type="checkbox"/></td>
    </tr>
    

    Fiddle: http://jsfiddle.net/DwerK/9/

    And then check for the attribute ‘data-isChecked’. You need to add the data prefix so that HTML will validate.

    Now I speculate that you could add the attribute to the parent element and then check it in code behind, not sure how exactly that would work and have not had an instance to check it.

    I hope that helps.

    EDIT: Wirey asked to see the issue, as I understand it this illustrates the issue: http://jsfiddle.net/w22Q4/2/

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

Sidebar

Related Questions

I have a Jquery Dialog box and the code is below, $(document).ready(function() { $(#dialogForm).dialog({
I have a jquery dialog modal box pop up for logging into my website.
I have JQuery dialog box for inserting new row in table. And everything works
I have this code to popup a JQuery dialog box: $( #dialogBox ).dialog({ height:
I have jquery ui dialog box, and I want to resize it by the
I have the following Jquery that returns values from a dialog Box and fills
I have the following issue: I open a dialog box with jQuery UI. This
When creating or editing object sin my table, I have a jquery dialog that
I have a JQuery dialog box on a page that calls something like this:
I have a youtube video appear in the jquery dialog box, so if it

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.