Bootstrap jQuery validation test [Solved]

Bootstrap jQuery validation test [Solved]
0

#1

I am attempting to do a mock form with validation.
I could get a validation plugin I know but I would rather just add and remove classes on a button click if possible. See pen:


#2

And your question is? It works fine; it adds the class if the name field is empty and removes it if non-empty.


#3

I needed to add e.preventDefault(); for it to work properly. Not sure why.


#4

I’m pretty happy with it now.