I’ve followed the instructions for implementing Formly (http://thrivingkings.com/formly/) and all the validation works a treat, it’s just when I add the JS code to handle the submit after the validate, the form submits to the server even though errors occur on the form. See the comment on the Formly website by “Faz”. Any ideas?
Thanks.
Actually Luvdubz and Faz are on the wrong track–they shouldn’t attach an event on the submit button the way they did:
Formly has actually done that for the developer. When the user successfully completes the form, ie passing validation, formly calls the callback function. Within the callback function, you can do whatever you like.
Easiest example would probably be: