Cannot run Validatinator correctly on 2+ forms with the same name
Closed this issue · 2 comments
At first glance, having multiple forms with the same names (and the same fields and validation rules) appears to work...but after an initial validation run, it's impossible to correct / re-validate the form again - I assume because it's getting stuck on another form of the same name.
The reason I have multiple forms is that this website in particular repeats the same newsletter signup form throughout a very long page and it's placed there via multiple includes.
It would be very repetitive to have to maintain forms as being distinct, even if they're the same with just a different name simply because validation wont run on multiple forms of the same name.
Any ideas with this at all? It's a bit of a road blocker for me. As far as I know Validatinator only works with names.
Extremely sorry for the delay in my response here. I'm well aware that this is probably an issue of the past, but I would like to follow up here and explain my reasoning for closing this issue.
Sadly with the way that Validatinator 1.x was created, there is no "easy" and/or "feasible" hotfix for alleviating the issue that you were having. At least, not without a decent sized rewrite, which is already being done for 2.0 (development to commence, again, there this week), or changing the way users interact with Validatinator's public methods.
I've previously made a note to make sure version 2.0 supports more options for querying forms and fields, and allows for multiple forms to easily share the same set of validation rules.
Thanks for raising this issue and, again, sorry for the delay in a response.
No worries Jenkins. Thanks for the response and I totally understand it would be quite complex to change. You have a great plugin and I would love to perhaps see a feature where by I can pass a custom query selector for validating forms. i.e. via class names, ID's or anything really.
Thanks for all your hard work! I'll be keeping an eye on the repo :)