Dynamically Set Submission Limit

Hi, I’m looking for some input here… I’m setting up a volunteer opportunities database of sorts using PODs. I’m using Gravity Forms to allow volunteers to register for any volunteer opportunity. Right now I have a single form that dynamically pulls in the necessary information from my “opportunities” database, Content like Title and Volunteer Limit. When they signup, they get added to the volunteer database. Pretty straight forward stuff.

My problem is I need to limit the form signups to whatever number that gets pulled into that hidden field. I’m thinking this might need to be a custom function, but my skills are pretty limited writing them. Can someone point me in the right direction or suggest another method of getting this done?

Any help is greatly appreciated! Thx!

I’m also interested in a solution to this… did you get any information @Brandon?

Hi @ckunderd - the $form object contains a property [limitEntriesCount] that contains the limit for the number of entries set in the form setting. Setting that when the form is rendered is not going to be very useful I don’t think (because it would not be stored in the settings, and there would not be any comparison.

One method may be to compare the number of entries the form already has (you can get this with the GFAPI::count_entries function:

to the value you are retrieving from Pods or similar. Then you can decide to show the form or not, based on the number of entries you can still receive. You can decide to show the form or not using the gform_get_form_filter:

If you have more details or more specific requirements, please let us know.

© 2008 - 2021. Gravity Forms is a project by Rocketgenius Inc.