How to start real-time validation after the first click on the submit button. Like in ParsleyJs (Example). I am using Vue from cdn (No ES6). I tried this but the validation will stop after the first submit.
methods: {
'sendMessage': function() {
this.$validator.attach('name', 'required|min:3');
this.$validator.attach('email', 'required|email');
this.$validator.attach('password', 'required|min:7');
this.$validator.validateAll().then((result) => {
if (result) {
// Send ajax
return;
}
});
}
}
Thanks.
Here is a small example I've created:
https://jsfiddle.net/logaretm/yxr3nehw/
There are a lot of undocumented API going there, I have added comments to the weird parts.
That is clever. I never thought about using Boolean value. Thanks a lot.
BTW: I am from Sudan.
Ah sister country, greetings to you.