Skip Navigation

[Resolved] Setting a maximum number of repeatable fields based on membership levels

This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.54 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#598749

Tell us what you are trying to do?

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?

Thank you very much.

#598792

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

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/