How about using Alpine.js for form validation
P粉345302753
2023-08-30 21:41:37
<p>I am discovering such a great Alpine.js framework.
But I can't find how to insert the complete form validation framework. </p>
<p>For years I used full JqueryValidation, but it requires JQuery ;-)</p>
<p>I tried Ionide.Js but it doesn't have many validators that plug into Laravel. </p>
<p>Vue.js has vuelidate and vee-validate, but I don't know how to make them compatible with Alpine.js. Are you? </p>
<p>So before I start writing code, I'm here to find out if I'm missing out on some cool receipts for client-side form validation using Alpine.js and a complete set of rules. </p>
<p>Thanks and Cheers</p>
Jquery has a lot of plugins and libraries that are hard to find in Alpine.js, I always look for vanilla js packages, and libraries that can be used with alpine.js. Form validation link is missing in Alpine.js. For form validation I use Pristine.js vanilla js validation library. You can add custom validation rules for fields and available validation rules
https://github.com/sha256/Pristine
https://codepen.io/blcveen/pen/abdpNKW
Hope this helps you with your form validation issues.