Hello.... I'm trying to build a directory-style website with Toolset. One of the features is to allow members to upload their images, up to 5 of them.
My question is: If I use the repeatable field for the image, how can I set the limit to 5 of them?
Also, I'm thinking that I might create 2 levels of memberships on my site with 2 different numbers of images members can upload. For example: With the Regular Plan, they get 5 images to upload. With the Premium Plan they get 10.
What is the best way to achieve this with Toolset?
This came up just yesterday in an internal discussion where the developer confirmed there is no means of limiting the number of repeating fields.
Presumably your users would be posting these in a CRED form. Because the images are uploaded via ajax as soon as they are selected ahead of the form being submitted (to save time processing the form when it is), I don't think normal server-side form validation will be much help here.
I think your best solution would be some custom JavaScript that removes the buttons to add more images once 5 have been submitted. In the markup for the form you could add a data attribute with the role of the current user so that your JavaScript would know whether to cut off adding images after 5 or 10 accordingly.
If that's not something you can do yourself you could try contacting one of the contractors listed here: https://toolset.com/contractors/