Developer forum

Forum » CMS - Standard features » Dynamic value for "Max number of submits" on forms for editors

Dynamic value for "Max number of submits" on forms for editors

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I know it is a long shot, but I have to ask it first.

I have a situation where I want to use a form for multuple pages without duplicating the form.

Imagine an event (like a training) with several dates and locations. Each date and location has its own number of seats available and I want to use "Maximum nuber of submits" for limiting the subscriptions.

I know I can set this value per instance of the Forms for editors modules. i was wondering if I can set a single instance of the Forms for editors and pass the max number of submits dynamically.

I know I need to use some sort of unique key for this (because otherwise the system will not be able to count the number of submits).

I was wondering if there is anyway of doing this without duplicating the Forms for editors paragraph. Or any other suggestion to accomplish the above behavior.

Thanks,

Adrian


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

You can overwrite the max submit number from paragraph settings by submitting af (hidden) field named "FormMaxSubmits".

But you cannot override how many times the form was actually submitted. That is a counter based on formid and pageid - so you cannot even have the form many times on different paragraphs on the same page.

It is easy though to hook into Notifications.Frontend.OnBeforeContent and make the check there and set the args.StopExecution = True if maxsubmits was reached.

BR Nicolai

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Nicolai

 

You must be logged in to post in the forum