HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


Note

Optimizely Forms is only supported by MVC-based websites and HTML5-compliant browsers.

## Query client-side events

The following JavaScript code shows how to handle client-side `epiforms` events in Alloy MVC templates.



For a QuickSilver site, put the following script before `@Html.RequiredClientResources("Footer")`.



The following jQuery event objects are notification-only:

  • `type` – Type of event.

  • `workingFormDOMElement` – The DOM element raises the event.

  • `workingFormInfo` – Contains meta-information of current Optimizely Forms.

  • `formData` – some submitting-related events, this property contains the standard `FormData` object of the submission.

Note

The form event handling script must be placed below the `@Html.RequiredClientResources("Header")`. For example:



Note

If event handling script is rendered using `EPiServer.Framework.Web.Resources.IRequiredClientResourceList`, then it must depend on `EPiServer.Forms.ConstantsForms.StaticResource.JS.FormsjQuery` and `EPiServer.Forms.ConstantsForms.StaticResource.JS.EPiServerFormsPrerequisite`. For example:



### .NET events

Form submissions (and form step submissions) must result in events.

  • `FormsStructureChange`

  • `FormsStepSubmitted`

  • `FormsSubmissionFinalized`

  • `FormsSubmitting`

The following example code catches server-side events in `InitializationModule`:



With `FormsSubmitting`, `FormsStepSubmitted`, and `FormsSubmissionFinalized` events, you can cast the `eventArgs` to `FormsSubmittingEventArgs`, where you can get information from `SubmissionData` (having `SubmissionData.Data` as `IDictionary<string, object>`) and the `FormSubmissionId`.

## List of events

  • `formsNavigationNextStep`

  • `formsNavigationPrevStep`

  • `formsSetupCompleted`

  • `formsReset`

  • `formsStartSubmitting`

  • `formsSubmitted`

  • `formsSubmittedError`

  • `formsNavigateToStep`

  • `formsStepValidating`

  • `FormsStructureChange`

  • `FormsStepSubmitted`

  • `FormsSubmissionFinalized`

  • `FormsSubmitting`