Closed aroncal closed 2 years ago
You've got a couple problems here:
wanted
which doesn't exist anywhere in your code. I'm sure if you check your console log it will show that error. AlpineJS is fragile like that. If you are having it use a variable that does not exist then it will break everything.I just added examples-bundled to the repository to show that it works bundled.
Thanks for the clarification and for the examples-bundled. I was missing the id/name attribute on the required field, I missed that on the documentation. I didn't have any problem with the variable "wanted": I just put here a reduced version of my code for clarity. Thanks again.
Hi:
I have an Alpine project and wanted to include this plugin to validate forms. I've followed bundling instructions here:
https://github.com/colinaut/alpinejs-plugin-simple-validate#bundling-and-initializing
But it doesn't seem to start the plugin (no spans for the error messages or aria attributes for invalid states are added), and neither any error arises on the console. The relevant parts of my code are:
index.js
index.html (I don't include any JS in the
because webpack takes care of bundling and inserting the bundle)Am I missing something? Thanks