Questions tagged [checked]

The `checked` attribute of the HTML `input` tag used to set the checked state of the control to “on” by default. Used to set the state of the `input` controls with the `type` attribute `"checkbox"` or `"radio"`.

The checked attribute of the HTML input tag used to set the checked state of the control to “on” by default. Used to set the state of the input controls with the type attribute "checkbox" or "radio".

Used to present one or more checkboxes in such a way that the state of the control at the point of page load is checked, and the user has to opt out rather than opting in, or perhaps presenting the user with a form — including a series of checkboxes — that he or she has previously filled in, and preserve the state of the selections that were made. The checked attribute allows you to set the checked state to “on” by default.

The checked attribute is also used for radio input controls. Unlike the checkbox, only one in a range of related radio inputs can be selected, and the checked attribute is used to identify which one is selected. If you accidentally mark as "checked" a number of radio inputs that share a given name attribute, the last one that’s marked as such will be selected.

Details: http://reference.sitepoint.com/html/input/checked

813 questions
6
votes
2 answers

Can a checkbox be checked by default in the stylesheet, rather than in an HTML attribute?

Like the title says: can a checkbox be checked by default in the stylesheet, rather than in an inline HTML attribute? Example from w3schools.com, the "car" box is checked:
Rachel
  • 107
  • 1
  • 3
  • 9
6
votes
5 answers

Datagridview checkbox checked when clicking the cell

I handle my checkbox click event with the CurrentCellDirtyStateChanged. What I want to be able to do is handle the same event when I click the cell that contains the checkbox too, i.e. when I click the cell, check the checkbox and call the…
Jnr
  • 1,504
  • 2
  • 21
  • 36
6
votes
3 answers

Fire event on Jquery check/uncheck

I want to set a variable (pageselected) as per the checkbox click/unclick event. The HTML code is :
mmt
  • 161
  • 1
  • 2
  • 13
6
votes
3 answers

jquery checkbox is unchecked

I have pagination that comes with checkbox in first column and each row. If any of checkbox is checked it will automatic slidedown full wide box from top, I use jquery here is code... $(':checkbox').change(function() { // use the :checked…
user3417953
  • 113
  • 2
  • 3
  • 9
6
votes
2 answers

Applying CSS rules based on input checkbox status

I'm currently developing a site that uses the :checked variable to apply rules to the CSS. I've got a checkbox input that when triggered, should accomplish two things. The first thing it should do is expand a div from a height of 0 to 200 when…
Matthew Beckman
  • 1,702
  • 2
  • 16
  • 28
6
votes
3 answers

getElementByName returns Type Error?

My code: var isSomethingChecked = (document.getElementByName("koalaCheck").checked || document.getElementByName("kangarooCheck").checked); Why does this code throw an exception called "Type Error"?
jth41
  • 3,808
  • 9
  • 59
  • 109
6
votes
1 answer

Windows XP x86 checked build?

It seems that it is impossible to find an image of Windows XP Professional x86 checked build. But I still need to support the software and do my work for that system. :( Yes, I know that I can install only the checked kernel on the free build, but I…
6
votes
2 answers

Change CheckBoxPreference summary based on checked state

I am trying to create an App where the preference summary changes based on the checked state of a CheckBoxPreference. I am not quite sure how to query preferences since a good old isChecked() won't work.
SweSnow
  • 17,504
  • 10
  • 36
  • 49
6
votes
3 answers

javascript change form onsubmit dynamically

I have a form with some action and onsubmit values, which is submitted through a submit input tag. The problem is that it should be submittable by two buttons, so I wrote a function for the second button to change the action and onsubmit values of…
user1507558
  • 444
  • 3
  • 7
  • 15
5
votes
6 answers

React checkbox if checked add value to array

Hi this might be a very newbie question to ask but here is my question. I have check boxes that represent all the days of the week. If a day is checked I want to add it to a array so that on submit I can pass the array to back-end. I copied check…
imkeVr
  • 442
  • 1
  • 7
  • 30
5
votes
1 answer

Are CSS Variable changes possible upon a radio button's checked selector being triggered?

I have the following CodePen: Test LCD with CSS Variables, in which upon clicking labels with specific digits, results in the appropriate LCD segments to be "lit" based on algebraic equations I've determined to mimic a BCD to 7-Segment Display…
Eliseo D'Annunzio
  • 592
  • 1
  • 10
  • 26
5
votes
4 answers

jQuery: checked value from variable name or $(this)

If I have some radio buttons: Apple
Banana
Carrot
and I then define the radio…
helgatheviking
  • 25,596
  • 11
  • 95
  • 152
5
votes
3 answers

Switch css doesn't work with input type radio

I have a switch button. But it doesn't work with the input type radio. If I try with checkbox button it works. Why? How can I solve, maintaining the radio input? @charset "utf-8"; /* CSS Document */ /* ---------- GENERAL ---------- */ body…
panagulis72
  • 2,129
  • 6
  • 31
  • 71
5
votes
8 answers

Checking a radio button with jQuery when radio button is runat="server"?

Using jQuery I want to be able to click an element which will also checks it's related radio button. I had this working fine until we had to add runat="server" to the radio buttons. When I apply this it prevents my jQuery function from working and I…
Wayne Austin
  • 2,979
  • 3
  • 25
  • 30
5
votes
2 answers

How to default collection_check_boxes to checked?

I have this line that I'm trying to default to checked <%= f.collection_check_boxes :committed, checked, Date::ABBR_DAYNAMES, :downcase, :to_s, %> In db t.text "committed". I tried variations of checked & true, but maybe I overlooked…
AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80