Skip to main content
4594 votes
44 answers
3.9m views

Setting "checked" for a checkbox with jQuery

I'd like to do something like this to tick a checkbox using jQuery: $(".myCheckBox").checked(true); or $(".myCheckBox").selected(true); Does such a thing exist?
tpower's user avatar
  • 56.8k
1085 votes
45 answers
2.4m views

How to style a checkbox using CSS

I am trying to style a checkbox using the following: <input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" /> But the style is not applied. The ...
Salman Virk's user avatar
  • 12.3k
5213 votes
68 answers
4.9m views

How do I check whether a checkbox is checked in 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 enter ...
388 votes
45 answers
520k views

POST unchecked HTML checkboxes

I've got a load of checkboxes that are checked by default. My users will probably uncheck a few (if any) of the checkboxes and leave the rest checked. Is there any way to make the form POST the ...
reach4thelasers's user avatar
1508 votes
27 answers
2.7m views

Check if checkbox is checked with jQuery

How can I check if a checkbox in a checkbox array is checked using the id of the checkbox array? I am using the following code, but it always returns the count of checked checkboxes regardless of id. ...
Jake's user avatar
  • 26.1k
177 votes
5 answers
539k views

Get $_POST from multiple checkboxes

I have 1 form in with multiple checkboxes in it (each with the code): <input type="checkbox" name="check_list" value="<? echo $row['Report ID'] ?>"> Where $row['Report ID'] is a primary ...
James Andrew's user avatar
  • 7,243
361 votes
18 answers
1.3m views

How can I check if a checkbox is checked?

I am building a mobile web app with jQuery Mobile and I want to check if a checkbox is checked. Here is my code. <script type=text/javascript> function validate(){ if (remember.checked == ...
Steaphann's user avatar
  • 3,699
866 votes
13 answers
1.9m views

Check/Uncheck checkbox with JavaScript

How can a checkbox be checked/unchecked using JavaScript?
lisovaccaro's user avatar
  • 33.8k
1020 votes
49 answers
1.2m 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 ...
320 votes
21 answers
1.0m views

How to read if a checkbox is checked in PHP?

How to read if a checkbox is checked in PHP?
Thew's user avatar
  • 16k
23 votes
4 answers
13k views

Getting an issue while checking the dynamically generated checkbox through list view

I know that this question is already asked by other members and solution is also given by some members but the thing is that i didnt find any solution which is suitable for my app. I am creating a app ...
himanshu's user avatar
  • 1,980
227 votes
13 answers
327k views

Do checkbox inputs only post data if they're checked?

Is it standard behaviour for browsers to only send the checkbox input value data if it is checked upon form submission? And if no value data is supplied, is the default value always "on"? Assuming ...
Mark's user avatar
  • 2,769
280 votes
31 answers
853k views

How to implement a "select all" checkbox in HTML?

I have an HTML page with multiple checkboxes. I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?
user48094's user avatar
  • 10.6k
246 votes
14 answers
612k views

How to retrieve checkboxes values in jQuery

How to use jQuery to get the checked checkboxes values, and put it into a textarea immediately? Just like this code: <html> <head> </head> <body> <div id="c_b"&...
lanqy's user avatar
  • 3,021
488 votes
10 answers
643k views

What's the proper value for a checked attribute of an HTML checkbox?

We all know how to form a checkbox input in HTML: <input name="checkbox_name" id="checkbox_id" type="checkbox"> What I don't know -- what's the technically correct value for a checked checkbox?...
buley's user avatar
  • 29.1k

15 30 50 per page
1
2 3 4 5
167