JqueryValidationBundle icon indicating copy to clipboard operation
JqueryValidationBundle copied to clipboard

Count constraints are not validated

Open BboyKeen opened this issue 10 years ago • 4 comments

Hi Boekkoi,

I can't find a way to make Count constraints work. Is this constraint implemented ?

I'm using dev-master.

Thanks !

BboyKeen avatar Nov 05 '15 00:11 BboyKeen

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.

boekkooi avatar Nov 05 '15 07:11 boekkooi

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" ?

BboyKeen avatar Nov 05 '15 10:11 BboyKeen

Sorry for the slow reply but I mean handling the count constraint when it is optional.

boekkooi avatar Nov 11 '15 19:11 boekkooi

Is there any update for this?

dannyvw avatar Jan 10 '17 19:01 dannyvw