adding 'extra registrants button' to behave with real-time spots left

By: Andy Siebelink | Asked: 10/09/2024
ForumsCategory: Code Snippetsadding 'extra registrants button' to behave with real-time spots left
Andy Siebelink asked 2 months ago

Hi there,
We currently run a couple of formidable forms on our website. We added a couple of code-snippets to the forms aswel. The way these form behaves is as such:

People can register on the form. We have set a max limit for the amount of people that can register. We allow them to add an additional 10 people. whenever they add multiple people, this amount will be subtracted from the total limit of people that can register. Everything seems to work just fine to this point however there is one issue. The button that allows you to add multiple registrants won\'t check the real-time amount of people that can still register.

For example. We have a form that has a limit to 12 registrants. Person 1 registers as a group for a total of 10 people. This person can click the button to add registrants without any issue and won\'t encounter the problem.

Person 2 tries to register 10 people afterwards, however this shouldn't be possible because there are only 2 spots left. The issue is that person 2 can still click on the button that allows you to register 10 people filling in everyones information just to get the message that there are just 2 spots left after confirming the form.

My question is: Is there a possibility for this button to behave with the real-time spots left. So if there are only 2 spots left on this form, this button will only allow you to click it 2 times before getting the message that there are just 2 spots left and you\'re unable to add more registrants.

Thanks in advance!

Attachments
1 Answers
Rob LeVineRob LeVine answered 2 months ago
Using jQuery you can set up a timer to consistently poll the system and using Ajax see how many open spaces you currently have and update the UI accordingly.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right