How to use BS4 validator

How to use BS4 validator
0.0 0

#1

Hey guys,I have been working on a BS4 contact form, I read on the offical website that BS4 offers it own form validation. I have been trying to use this but it’s not working(validating before filling the form). Result needed:

  1. Please show me what I am doing wrong.
  2. what must I change and why.
  3. I am using the official Bootstrap 4 NOT beta or alpha.

Thanks


#2

Not that it matters, but you are using the beta.

Anyway, you should not add the is-valid class to your input's, that is something Bootstrap will do for you.

Next, you have to use standard HTML5 form validation. If you don’t use anything, Bootstrap will just assume everything is fine. The easiest validation is adding required to an input: <input type="..." required />. You will see that now when you click “Submit” (without filling in anything) it will indicate that your input is not valid.