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

add validation feedback/tooltip support to form-check-inputs #25210

Merged
merged 2 commits into from Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 30 additions & 1 deletion docs/4.0/components/forms.md
Expand Up @@ -776,6 +776,17 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied
</div>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="invalidCheck" required>
<label class="form-check-label" for="invalidCheck">
I agree
</label>
<div class="invalid-feedback">
You must agree
</div>
</div>
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>

Expand Down Expand Up @@ -842,6 +853,14 @@ While these feedback styles cannot be styled with CSS, you can still customize t
<input type="text" class="form-control" id="validationDefault05" placeholder="Zip" required>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="invalidCheck2" required>
<label class="form-check-label" for="invalidCheck2">
I agree
</label>
</div>
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
{% endexample %}
Expand Down Expand Up @@ -903,7 +922,17 @@ We recommend using client side validation, but in case you require server side,
</div>
</div>
</div>

<div class="form-group">
<div class="form-check">
<input class="form-check-input is-invalid" type="checkbox" value="" id="invalidCheck3" required>
<label class="form-check-label" for="invalidCheck3">
I agree
</label>
<div class="invalid-feedback">
You must agree
</div>
</div>
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
{% endexample %}
Expand Down
5 changes: 5 additions & 0 deletions scss/mixins/_forms.scss
Expand Up @@ -74,6 +74,11 @@
~ .form-check-label {
color: $color;
}

~ .#{$state}-feedback,
~ .#{$state}-tooltip {
display: block;
}
}
}

Expand Down