My client wants to be able to display the same registration form for multiple events without having to copy the form.
But when adding the same form multiple times on a page, submitting one triggers all of them.
Why does this happen and is there a way to prevent it?
Each event has it's own plugin but the form UID is the same. Using multiple forms on the same page with different UID's works fine.
My client wants to be able to display the same registration form for multiple events without having to copy the form.
But when adding the same form multiple times on a page, submitting one triggers all of them.
Why does this happen and is there a way to prevent it?
Each event has it's own plugin but the form UID is the same. Using multiple forms on the same page with different UID's works fine.
Share Improve this question asked Mar 3 at 8:42 OloethOloeth 961 bronze badge 2- You should add more details and explain why the same form must be placed on the same page. Even if the forms would not be submitted simultaneously currently this hardly makes sense even for human visitors. – Mathias Brodala Commented Mar 3 at 8:53
- The page containes 1-5 events and the designer wants a form for each event. The form is within an accordion so they're not all immediately visible. But there's no point in discussing how much sense it makes. The client hired a fancy designer who designed a "fancy" site and my job is to implement it. – Oloeth Commented Mar 3 at 9:17
1 Answer
Reset to default 0I would suggest to only add the form once on the page. And then use JavaScript to show the form when opening the accordion. Then you need to make sure, that only one accordion item can be opened at time showing the form.
As another Option you could check out Powermails PSR-14 Events.
https://docs.typo3./p/in2code/powermail/12.5/en-us/ForDevelopers/EventDispatcher.html
Maybe you can use the FormControllerCreateActionBeforeRenderViewEvent
. I would try to implement the EventListener and there check $this->contentObject
.
Then you maybe can cancel the execution of the unwanted forms.
I did not test, but i would give a try.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745103092a4611392.html
评论列表(0条)