Setting a Registration Form Dynamically from "Regular" to "Waitlist"?

I’m working on a way to dynamically switch an Event Registration form from the “Regular” registration default to “Waitlist”
by checking before Form page load the Seating Limit in the events table.

Registrants are allowed to submit “Waitlist” registrations if the Event is filled up – 70 “Regular” category records stored for an Event with a 70 seat maximum.

In PHP & mySQL applications I’d do a count with an sql query & see if the existing records were less than or equal to the seat limit value.

If I already had 70 “Regular” value Registrations then the Form would display that this was a Waiting List registration & Would the User like to continue with submitting the form as a request to be on the Waiting List in case there were cancellations.

I had different methods – including subtracting each registration from the seating limit until it reached 0 and setting the Waitlist from that value

Or doing a live query to simply count open Regular registrations & switch to “Waitlist” Type for the next Registration submit.

This was all Server Side.

So I’m wondering if some experienced Wappler users have an approach for Dynamic Browser side actions to get this same Case or Switch?

Each event master list has a field assigned with a numeric value of the maximum number of seats available for this event.

This is the value that everything is checked against.

When 70 records, for instance, with the “Regular” value are reached,
then all following Users can only Submit a form where the Type value is read-only “Waitlist”.

My other question is if this should be both a Server side action & browser side, too.

Thank you for your Wappler feedback!

In the server action add a query which returns the maximum number per event and another one which returns the count of the currently reserved seats.
Add a condition there, which checks if the number of reserved seats < of the the maximum number for the event.
In the THEN part (when the condition is met) of the condition step add your insert step, which inserts in the event table
In the ELSE part of the condition step add another insert step, which insert in the waiting list table.

On the front end, if you want to show users the seats are full and you want to change some text in the form, just do a similar check and use the dynamic show/hide attributes to show or hide some text.

2 Likes

Okay! I think I’m good to go, Teodor!
I’ve been wanting to try the dynamic show/hide attributes.

I’ve used them before in javascript & jquery conditions for php querying mysql tables.

So now I’ll check out the Wappler actions & conditionals in app components.

Thank you.