AI OnAI Off
You could try hooking into the FormsSubmitting or FormsStepSubmitted events:
http://world.episerver.com/add-ons/episerver-forms/handling-events-for-Episerver-forms/
Thanks!
I hooked into the FormsSubmitting-event and was able to get previous submissions, and check number of earlier submissions from the same IP.
I used the following code to get the previous submissions:
var formsDataStore = ServiceLocator.Current.GetInstance<FormsDataStore>(); var resultset = formsDataStore.Get(submittingEventArgs.FormsContent.ContentLink, null, null, null, null, false, null);
This works fine as long as I'm logged into EPiServer, but for unauthenticated users resultset.Data is null.
Can this be done for unauthenticated users? I would prefer not to use the Forms.ServiceApi
I would like to add custom validation for a EPiServer Form, and have found information about how to add validators to specific fields.
What is the best approach for form wide validation, for example:
- Validate that not more than 10 forms are submitted from the same IP-range.
- Validate that if textbox1 and textbox2 are left empty, textbox3 are required.