Hi everyone,
I'm using the subscriber: [Subscribe(Dynamicweb.Forms.Notifications.Frontend.OnAfterSubmitSave)]
And what I'm trying to accomplish is to validate an email on form submit and if the email doesnt comply with my criteria, i wish to cancel the submit somehow. The only option I can find that seems to somewhat do what I want is:
if (args == null || !(args is Dynamicweb.Forms.Notifications.Frontend.OnAfterSubmitSaveArgs))
{
return;
}
Dynamicweb.Forms.Notifications.Frontend.OnAfterSubmitSaveArgs submitArgs = args as Dynamicweb.Forms.Notifications.Frontend.OnAfterSubmitSaveArgs;
submitArgs.Submit.Delete();
Is this the only way or is there a better way to 'cancel' the submit if a condition is met?