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.

is-(in)valid doesn't seem to work at all

See original GitHub issue
<form action="" class="was-validated">
  <input type="text" class="form-control is-invalid">  
</form>

:valid seems to have higher priority over is-invalid, hence the input is green. I have a piece of JavaScript which decides if the input is valid or not, and adds this class.

  • Operating system and version: macOS High Sierra
  • Browser and version: Google Chrome
  • Reduced test cases and potential fixes: https://jsfiddle.net/fxxrqd13/

Related: https://stackoverflow.com/q/47427827/1420197 Related issue: #24743

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
IonicaBizaucommented, Nov 25, 2017

@mdo I understand that, but how can we combine them?

My use case is that I use .was-validated on the form, and call the checkValidation() method, except one field has custom validation (I want to add is-(in)valid classes there).

3reactions
mdocommented, Nov 24, 2017

The docs are pretty clear on this—.was-validated for is for live HTML5 validation in the browser while the classes .is-valid and .is-invalid are for custom validation you’d setup. In your latest fiddle, you were still using the class on the input when you should be using the required attribute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring portlet mvc: @Valid does not seem to work
I created a bean class and use it in my controller but it does not seem to work. Namely even though I enter...
Read more >
Notarized app gets this message: r… | Apple Developer Forums
Notarized app gets this message: rejected (the code is valid but does not seem to be an app) ... I've successfully notarized my...
Read more >
invalid - CSS: Cascading Style Sheets - MDN Web Docs
The :invalid CSS pseudo-class represents any , , or other element whose contents fail to validate.
Read more >
Restrict data input by using validation rules - Microsoft Support
Field Validation Rule You can use a field validation rule to specify a criterion that all valid field values must meet. You should...
Read more >
Page Indexing report - Search Console Help - Google Support
If your page or site is new, wait a few days for Google to find and crawl it. In an urgent situation, or...
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