Developer forum

Forum » Development » Forms before save notification subscriber

Forms before save notification subscriber

Anders Ditlevsen
Anders Ditlevsen
Reply

Hi, i've looked around but im unable to find a BeforeSave or BeforeSubmit to subscribe to on forms. Currently im using an After, which looks like this: [Subscribe(Dynamicweb.Modules.Forms.Notifications.Frontend.OnAfterSubmitSave)]

I've looked through the intellisense and cannot seem to find such a subscriber, i've also looked here: http://developer.dynamicweb-cms.com/api8/#Dynamicweb~Dynamicweb.Notifications.Module_members.html

What i want to do, is to stop a submit from a form in the backend, depending on a parameter in the form.

Does a notification subscriber exist for the BeforeSave or BeforeSubmit on forms, like the AfterSubmitSave i show above for form, and where can i find this?

 


Replies

 
Nicolai Pedersen
Reply

Hi Anders

The Dynamicweb.Modules.Forms.Notifications are related to the forms module in the frontend and will not fire when things happens in the backend.

Instead Notifications.Standard.Application.BeginRequest can be used since it fires whenever anything in Dynamicweb is executed - frontend and backend. In that one you can take a look at the request path and the values in request forms.

 
Anders Ditlevsen
Anders Ditlevsen
Reply

Excellent, however when i've done my logic and so forth, how would i go about actully stopping the request, and simple sending the user back to the same it came from, or alternatively send the user to some other site? 

 
Nicolai Pedersen
Reply

Do a response.redirect back to the forms page...?

 

You must be logged in to post in the forum