A checkbox is a graphical user interface element that permits the user to make a binary selection.

learn more… | top users | synonyms (1)

941
votes
25answers
663k views

Check checkbox checked property using jQuery

I need to check the checked property of a checkbox and perform an action based on the checked property using jQuery. For example, if the age checkbox is checked, then I need to show a textbox to ...
901
votes
22answers
601k views

How do I check a checkbox with jQuery or JavaScript?

I want to do something like this $(".myCheckBox").checked(true); or $(".myCheckBox").selected(true); I wish to set the value. Is such a thing built into jQuery?
195
votes
20answers
130k views

How to handle checkboxes in ASP.NET MVC forms?

This seems a bit bizarre to me, but as far as I can tell, this is how you do it. I have a collection of objects, and I want users to select one or more of them. This says to me "form with ...
180
votes
31answers
139k views

Can HTML checkboxes be set to readonly?

I thought they could be, but as I'm not putting my money where my mouth was (so to speak) setting the readonly attribute doesn't actually seem to do anything. I'd rather not use Disabled, since I ...
88
votes
4answers
68k views

Jquery selector for the label of a checkbox

<input type="checkbox" name="filter" id="comedyclubs"/> <label for="comedyclubs">Comedy Clubs</label> If I have a check box with a label describing it, how can I select the label ...
74
votes
8answers
41k views

How to create an HTML checkbox with a clickable label

How can I create an HTML checkbox with a label that is clickable (i.e. clicking on the label should turn the checkbox on/off)?
69
votes
6answers
122k views

How to style checkbox using CSS?

I am trying to style checkbox using the following: <input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" /> But, it is still displaying the default checkbox. ...
43
votes
6answers
66k views

How to uncheck checkbox using jQuery

I have a problem with unchecking a checkbox. Have a look at my jsFiddle. I use uniform for styling the checkbox and it simply does not work to check/uncheck the checkbox. Any ideas?
31
votes
6answers
23k views

jQuery, checkboxes and .is(“:checked”)

When I bind a function to a checkbox element like: $("#myCheckbox").click( function() { alert($(this).is(":checked")); }); The checkbox changes it checked attribute before the event is ...
7
votes
3answers
6k views

Gmail-like ListView with checkboxes (and using the ActionBar)

I'm trying to recreate what Google did with the ListView in the Gmail app. In particular, I would like to have each list item include a CheckBox and two TextViews (one on top of the other). I need ...
6
votes
3answers
34k views

Javascript checkbox onChange

I have a checkbox in a form and I'd like it to work according to following scenario: if someone checks it, the value of a textfield (totalCost) should be set to 10. Then, if I go back and uncheck ...
5
votes
4answers
11k views

Android checkbox style

I am new to android and I'm trying to set a style to all check boxes in my application. My application style is set to Theme.Holo which is dark and I would like the check boxes on my list view to be ...
5
votes
3answers
30k views

Creating the checkbox dynamically using javascript?

I am trying to create a checkbox dynamically using following html/javascript. Any ideas why it doesnt work? <html> <head> </head> <body> <div id="cb"></div> ...
5
votes
4answers
9k views

Jquery stop form submit unless checkbox selected

I've got this code, but it doesn't seem to return true. The alert always shows up. Any thoughts (without needing to create a var in which to store that a checkbox has been selected as that just seems ...
0
votes
2answers
26 views

Iterating through array and uploading data into rows in database

I have a few checkboxes that i want to insert their values into a database if they are checked. HTML: <input type="checkbox" id="m1" name="category[]" value="1"/> <input type="checkbox" ...

1 2 3 4 5 465
15 30 50 per page