Display Number of Entries Left Based on Entry Limit

This snippet is also available as an easy-to-use shortcode. Check it out.

Want to really entice your visitors into submitting your Entry Limit-enabled form? Display the number of entries left based on the entry limit!

Be aware, this snippet only works when limiting by “total entries”:

Entry Limit by Total Entries

You can customize the entries left message by updating the $entries_left_variable. Be sure to place the %s wherever you would like the actual number of entries left to display.

Does this snippet just not quite fit what you’re looking to do with Gravity Forms? Let us know in the comments or via the Ask Wiz form! We tempestuously want to hear what kind of magical Gravity Forms functionality you need.

Comments

  1. Joe
    Joe November 15, 2016 at 6:33 am

    Hi David. We’re looking for a slight variation on a theme here. We have a form as a job application. We’d like to limit the form submission to one application per user. This is the same form used for every job, so it would need to work for each new job and per user. There’s a challenge for you! Any ideas?

    Reply
  2. Phil
    Phil February 9, 2015 at 10:27 am

    Hello,

    we want to buy gravity Perks because we would like to use GP Limit Choices.

    Is it somehow possible to outout (e.g.via a shortcode) within an post the remaining choices for every option in an option field?

    Thanks

    Phil

    Reply
  3. drijen
    drijen July 8, 2014 at 8:54 am

    Hi David,

    This sounds great. I need to be able to limit choices e.g. we will have ‘no. of places left’ but on one form we have multiple classes so each class will have to have a limited no. of entries.

    E.g. Class 1: 20 places, Class 2: 15 places, Class 3: 10 places.

    This seems to be able to do that: https://gravitywiz.com/documentation/gp-limit-checkboxes – can you confirm, before we purchase it?

    We need to then display ‘no. of places left’ for each of the classes.

    e..g if 10 people have applied to all 3 classes, on the front end we need to display: Class 1: 10 places left Class 2: 5 places left Class 3: Fully booked

    Is this possible?

    Reply
  4. Al
    Al April 1, 2014 at 4:52 pm

    Is there a way of reversing this to count all entries across multiple forms and then display how many people in total have registered for a tournament and place it as a shortcode on a page or sidebar?

    “X” Teams Registered To Date

    Reply
  5. Segovia Smith
    Segovia Smith April 30, 2013 at 11:54 am

    We’re trying to setup a volunteer registration form and we have 4 different roles people can signup for. Each role requires a different number of volunteers (cook=2, bottle washer=4, hostest=1, etc.) so rather than being able to use the GravityForms default limited number of entries, we need to limit the number of entries for each of these options which I want to do via either a drop down menu, check box or radio button. Got any brilliant ideas?

    Sorry if this is a little off topic.

    Reply
    1. David Smith
      David Smith Staff April 30, 2013 at 12:29 pm

      Hi Segovia, Gravity Perks has the GP Limit Choices perk which will allow you to specify a limit per choice in a drop down, checkbox or radio button field. :)

  6. Brad Weaver
    Brad Weaver September 28, 2012 at 4:41 pm

    Any chance you could get this to work on a per day instead of total entries or can you possibly explain why that’s a no-go? Any help would be appreciated!

    Reply
    1. David Smith
      David Smith Staff September 28, 2012 at 7:13 pm

      This could be configured to display the per day limit but it’d require some additional customization. Primarily, the $entry_count variable would need to be modified to use a custom query to return just the entries from that day.

  7. Atlante Avila
    Atlante Avila September 19, 2012 at 2:24 am

    Is there a way to add this to a post? Like say I have a list of events. I then create a post for each event with a link to it’s appropriate form, is there a way to display in that post the number of spots left in that particular form?

    Thanks! For the code!

    Reply
    1. Atlante Avila
      Atlante Avila September 19, 2012 at 2:32 am

      Also, is there a way to apply to all forms instead of having to specify a form id? Why isn’t this feature come stock with gravity forms? Doesn’t it seem pretty basic to add this functionality out of the box? Thanks for your future answers!!

    2. David Smith
      David Smith Staff September 19, 2012 at 7:36 pm

      Hi Atlante,

      • Check this out for a method to show this inline in your post content: Shortcode: Display Entry Limit

      • To update this current snippet to apply to all forms, you should just be able to drop the '_4' from the filter name here: 'gform_pre_render_4'

  8. Nate
    Nate June 4, 2012 at 11:12 pm

    Thanks for this. I assume the code is placed in the functions.php of the theme, is that correct?

    Also, is there a demo of this functionality?

    Thanks again.

    Reply
    1. David Smith
      David Smith Staff June 5, 2012 at 7:58 am

      Hi Nate, that is correct. No demo available but you’ll know it’s working if you see your limit message displayed in the form description.

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Download Snippet

Display Number of Entries Left Based on Entry Limit

This field is for validation purposes and should be left unchanged.