JqueryValidationBundle
JqueryValidationBundle copied to clipboard
Count constraints are not validated
Hi Boekkoi,
I can't find a way to make Count constraints work. Is this constraint implemented ?
I'm using dev-master.
Thanks !
Hi @BboyKeen,
It's totally correct that the count constraint is not working because it is indeed not implemented.
~~Now you may ask why is this not implemented. Well the simple answer is because it is almost impossible to build a proper generic implementation due to the fact that it's hard to know what to count exactly. another reason is because it is not actually bound to a form field so this also makes it harder to implement.~~
A possible custom JS implementation is in the issue-29 branch but is still missing handling none required collections with count support and the css selection is breakable and I needed to extend $.validator.prototype.elements but hey it works as a prototype. It still needs tests and some more love.
So feel free to put a PR in that improves on this.
Thanks for your quick and detailed answer. I'll dig into the implementation you've provided.
Could you give me an example of what you call "None required collections" ?
Sorry for the slow reply but I mean handling the count constraint when it is optional.
Is there any update for this?