92 Posts
Seb
6 years ago
5
Topic

Hi,

I think that is possible with Code pack and "Before Render". 

In my event registration form, I would like to limit the number of participants per day.
For example, my event is 3 days:
day 1: limited to 15 people
day 2: limited to 15 people
day 3: limited to 15 people

A person can choose to participate in 1, 2 or 3 days.

How can I automatically disable the registration field for a day when it is full? Maybe with Code pack, but how to do it?

Thanks for your help!

Get a Book for SEBLOD
215 Posts
iliil
6 years ago
1
Level 1

Hi

I think this would do the job.

https://www.seblod.com/resources/extensions/plug-ins/sql-pack

You can use the result of custom SQL query as a form field restriction .

Michal

92 Posts
Seb
6 years ago
0
Level 2

Thanks Michal!

Yes, I think this plugin can do what I'm looking for. Nevertheless I am not very strong in SQL, can you tell me if the following request would be valid.

I would like to be sure before buying this plugin.

SELECT SUM(day_1) AS day_1_total
FROM site_cck_store_form_event
WHERE day_1_total < 16

Thanks for your help!

92 Posts
Seb
6 years ago
2
Level 1

Hi

I bought the SQL PACK plugin, it works perfectly.
But when it is used as a restriction, I would have liked to be able to choose the state of the field: deactivated, masked, value or read only.
Currently the state is disabled only, the field can not appear width default value in the field "E-mail" for example

Maybe an option to add in a future version?

THanks!

Seb

4229 Posts
Kadministrator
6 years ago
1
Level 2

Hi,

this won't happen as this is how restriction works, it basically removes field from the fields. 

To get what you desire you can add another field with the same storage, set desired variation e.g. read-only and then add the same restriction, but with Invert option set to yes. This means that field will only show when restriction happens. This way you will always have only one of this 2 fields displayed at the same time.

92 Posts
Seb
6 years ago
0
Level 3

Thank you for your reply,
I did not know that we could use the same storage for two different fields, it's a solution indeed.
Thank you

Get a Book for SEBLOD