How about using Alpine.js for form validation
P粉345302753
P粉345302753 2023-08-30 21:41:37
0
1
406

I am discovering such a great Alpine.js framework. But I can't find how to insert the complete form validation framework.

For years I used full JqueryValidation, but it requires JQuery ;-)

I tried Ionide.Js but it doesn't have many validators that plug into Laravel.

Vue.js has vuelidate and vee-validate, but I don't know how to make them compatible with Alpine.js. Are you?

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.

Thanks and Cheers

P粉345302753
P粉345302753

reply all (1)
P粉968008175

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

Here is simple example Pristine used with alpine.js

https://codepen.io/blcveen/pen/abdpNKW

Hope this helps you with your form validation issues.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!