Questions tagged [checkbox]

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

A checkbox is a graphical user interface element that permits the user to make a binary selection. Checkboxes are often shown on the screen as a square box that can contain white space (for false) or a tick mark or X (for true). A caption describing the meaning of the checkbox is normally shown adjacent to the checkbox. Inverting the state of a checkbox is done by clicking the mouse on the box, or the caption, or by using a keyboard shortcut, such as the space bar.

Source: http://en.wikipedia.org/wiki/Checkbox


Some applications optionally allow a third state of Null, usually indicated by a grayed-out appearance. A similar provision is often made for a new record which has no instantiated values.

Here is an example of HTML code to present a checkbox in a user-entry form:

<input type="checkbox" name="example" value="foo">foo
  • The checked attribute is a boolean attribute.
  • When present, it specifies that an element should be pre-selected (checked) when the page loads.
  • The checked attribute can be used with <input type="checkbox"> and <input type="radio">.
  • The checked attribute can also be set after the page load, with a JavaScript.
29830 questions
370
votes
45 answers

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 checkboxes that are not checked, rather than the ones…
reach4thelasers
  • 26,181
  • 22
  • 92
  • 123
335
votes
18 answers

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.