question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML5 validation look and feel does not match with Bootstrap

See original GitHub issue

When I pass on the HTML5 attribute required to a FormControl like that (in React):

<FormControl
  required={required}
  {... input}
>
  {this.props.children}
</FormControl>

and submit that then this HTML5 validation error text pops in:

screen shot 2017-06-09 at 11 40 06

which does not match with the usual Bootstrap look and feel.

Using react-bootstrap v0.31.0 here which uses bootstrap v3.3.x and using latest Chrome v59 on Mac OS Sierra here.

I expect that kind of error text to be shown in the ControlLabel instead. Or at least make use of HTML’s native setCustomValidity() and wire it with Controllabel? Not sure if that’s doable …

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
binarykitchencommented, Jun 11, 2017

thanks but i really dont have the time due to familiar circumstances. just can point to this API for now https://developer.mozilla.org/en-US/docs/Web/API/ValidityState

whenever input changes, parse validation state from that API and display its contents on your error label or whatever similar.

0reactions
TheBuzzer67commented, Jun 11, 2017

Is there something I can do to help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validation · Bootstrap v5.3
Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.
Read more >
How to Validate Forms with Bootstrap 5 - Designmodo
How to use Bootstrap 5 form validation to showcase some decent actionable feedback on form data fields and validate forms.
Read more >
Bootstrap Validation - examples & tutorial
Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.
Read more >
bootstrap 5 form validation is not working for textarea pattern ...
I believe textarea cannot be validated using the pattern attribute and needs to be done via JavaScript. · Maybe check out this answer...
Read more >
HTML5 Form Validation Examples < HTML - The Art of Web
Different browsers may mark the input box in some way (Firefox 4 Beta adds a red box-shadow by default), display a warning (Opera)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found