Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gabor Ferencz 40 posts 181 karma points
    Oct 08, 2020 @ 08:25
    Gabor Ferencz
    0

    Attaching onto Form Save event of a form

    Hi there,

    Is there any way of attaching onto the form saving event of an umbraco form? I'm trying:

     public class FormsSavingContentComposer : ComponentComposer<FormSavingEventHandler>
    {
    
    }
    public class FormSavingEventHandler : IComponent
    {
        private readonly IFormService _formservice;
    
        public FormSavingEventHandler(IFormService formservice)
        {
            _formservice = formservice;
        }
        // initialize: runs once when Umbraco starts
        public void Initialize()
        {
            _formservice.Saving += FormServiceOnSaving;
            _formservice.Creating += FormServiceOnSaving;
        }
    
        private void FormServiceOnSaving(object sender, FormEventArgs e)
        {
    

    But this is not being fired, so I'm at a bit of a loss as to how I can achieve what I need to.

    What I need to do is to check that a form contains some fields, and their default values match some pre-set parameters.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft