Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9861 closed bug (invalid)

Problem with ASP.Net-CheckBox-Control and CSS-Class

Reported by: anonymous Owned by: anonymous
Priority: low Milestone: None
Component: css Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


Hello, I observed the following problem. I use ASP.NET and jQuery. When clicking on the checkboxes, the div has to change color. But this only works correcty with the input control. When clicking on the .Net-control, the color only changes to blue, so it does not recognize the true state of the control (active, inactive). The problem only(?) appears when using the css-class-property.

<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function() {
            $(".aspCb").click(function() {
                if (this.checked) {
                    $('.example').css('background', '#ffff00');
                else {
                    $('.example').css('background', '#0000ff');

            $(".cb").click(function() {
                if (this.checked) {
                    $('.example').css('background', '#ffff00');
                else {
                    $('.example').css('background', '#0000ff');
    <asp:CheckBox ID="aspCb" CssClass="aspCb" runat="server" />
    <input type="checkbox" id="cb" class="cb" />
    <div class="example" style="width:100px; height:100px">text

Change History (2)

comment:1 Changed 12 years ago by timmywil

Component: unfiledcss
Owner: set to anonymous
Priority: undecidedlow
Status: newpending

Thanks for taking the time to contribute to the jQuery project!

If an issue is only experienced when using ASP.NET and the issue is not reproducible with jQuery alone, this is probably not a jQuery issue. However, if it can be reproduced, please provide a reduced test case on http://jsfiddle.net that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge)(or jQuery git) version to ensure the issue still exists.

comment:2 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.