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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:15:21+00:00 2026-05-22T19:15:21+00:00

I have a <asp:Checkbox /> and I want to see whether it’s checked or

  • 0

I have a <asp:Checkbox /> and I want to see whether it’s checked or not via jQuery. Problem is, it always returns false. Does it have to do with the fact that I’m selecting the element via class?

The js

$(document).ready(initialize);

var map;

function initialize() {

    var x;
    x = $(".chkSetMap");
    x.click(setMap);
}

function setMap() {

    if ($('.chkSetMap').attr('checked') == true) {
        $(".comboMap").attr("disabled", true);

    }
}

the checkbox

    <asp:CheckBox ID="chkSetMap" CssClass="chkSetMap" runat="server" />

the checkbox rendered

<span class="chkSetMap"><input id="ctl00_ContentPlaceHolder1_chkSetMap" type="checkbox" name="ctl00$ContentPlaceHolder1$chkSetMap" /></span>
  • 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-22T19:15:22+00:00Added an answer on May 22, 2026 at 7:15 pm

    Try using the .is() method and the :checked shorthand selector

    $(document).ready(initialize);
    
    var $chkSetMap;
    
    function initialize() {
        $chkSetMap = $(".chkSetMap input:checkbox").click(setMap);
    }
    
    function setMap() {
        $(".comboMap").attr("disabled", $chkSetMap.is(':checked'));
    }
    

    working example: http://jsfiddle.net/hunter/5XA7D/ UPDATED!


    Since ASP.Net server controls are awesome it’s wrapping your checkbox in a span. The span has the chkSetMap class, not the checkbox.

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

Sidebar

Related Questions

I have some checkboxes in vb.net code. <tr> <td colspan=2> <asp:CheckBox ID=chkbxCreateAmendOrg runat=server Checked=False
I have next code, <form id=form1 runat=server> <asp:Label runat=server ID=Label1 EnableViewState=false /> <asp:CheckBox runat=server
I have an ASP.NET checkbox, and I want to run some javascript before it
I have an asp.net CheckBox, now I want to reload page after check or
I have a statement that looks like this: <asp:CheckBox ID=CheckBoxProcess Checked='<%#Eval(processedField) %>' OnCheckedChanged=CheckBoxProcess_CheckedChanged runat=server
I have an asp:checkbox control, and I want to change the visibility of a
Hello everyone I have a checkbox I want to check if its checked or
i have a checkbox in gridview. <asp:CheckBox ID=chkStatus runat=server Checked='<%#GetStatus(Eval(VaccinationCompletedStatus)) %>'/> The function GetStatus
i'm using ASP.NET ,i have a gridview with a checkbox element , i want
I have a gridview that contains a CheckBox. <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=false OnRowCreated=GridView1_RowCreated BackColor=#F1EFC5

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.