Skip to content
Advertisement

How to call form validity event if no input is entered

I have a simple form with bootstrap which I need to validate before submitting. It has auto support for invalid-feedback. It looks like this

JavaScript
JavaScript

Now when I type an input I immediately see an error if !validString (because of the input eventlistener). But if I just click on the submit button it is not calling the validString function.

What should I do ?

Advertisement

Answer

JavaScript
Advertisement