Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation states not working on radio, checkbox, form-control-static #10522

Closed
manishtpatel opened this issue Sep 8, 2013 · 7 comments
Closed

Comments

@manishtpatel
Copy link

Validatio states should work the same for radio and checkboxes as well. If applied .has-error class on .form-group containing radio and/or checkboxes should apply styles on them as well. It is not happening right now.

image

@fchiumeo
Copy link

fchiumeo commented Sep 8, 2013

Bootstrap Documentacion

Bootstrap includes validation styles for error, warning, and success states on form controls. To use, add .has-warning, .has-error, or .has-success to the parent element. Any .control-label, .form-control, and .help-block within that element will receive the validation styles.

@cvrebert
Copy link
Collaborator

cvrebert commented Oct 3, 2013

form-control-static is also affected, apparently.

@yokomizor
Copy link
Contributor

IMO it's right. You just have to mark your label with .control-label class.
Maybe it just needs some doc improves.

<label class="radio control-label">
  <input type="radio"> Italian
</label>

@yokomizor
Copy link
Contributor

@cvrebert I think .form-control-static shouldn't be marked because the user cannot fix this value.

What you think?

@mdo mdo closed this as completed in dd34102 Oct 21, 2013
pytkin added a commit to designmodo/Flat-UI that referenced this issue Feb 5, 2014
stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
…o, .checkbox, .radio-inline, and .checkbox-inline
@tkrotoff
Copy link
Sponsor Contributor

tkrotoff commented May 6, 2014

@mdo fix does not change the input radio/checkbox itself.

All other form elements change their border color when has-* is present except input radio/checkbox:

To fix this, CSS outline should be used since input radio/checkbox don't have a border:

.has-error input[type="radio"] {
  outline: 1px solid @state-danger-text;
}

It does not look great inside the browser (Chrome 34 Win7) but at least it is coherent with the other form inputs.

@mdo
Copy link
Member

mdo commented May 8, 2014

We won't be styling the radio and checkbox inputs.

@danolsavsky
Copy link

"We won't be styling the radio and checkbox inputs." - Yet another bad practice for usability and accessibility. @tkrotoff Fantastic solution! We've found having the border around individual checkboxes in a group becomes rather cumbersome. Instead, we wrap a field set or div (whichever is most semantically applicable) around them and add our red border to that. Cheers!

@twbs twbs locked and limited conversation to collaborators Sep 9, 2014
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
…o, .checkbox, .radio-inline, and .checkbox-inline
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants