Hide menu Last updated: Nov 02 2016
Area: Episerver Add-ons Applies to versions: Forms 2 and higher

Configuring forms

Note: Episerver Forms is only supported by MVC-based websites and HTML5-compliant browsers.

Forms store its fundamental configuration in the  _protected/EPiServer.Forms/Forms.config file.

  • The following configuration restricts who is able to view submitted form data. Edit is the default; an Editor at least should have Edit access rights on the form content to view SubmissionData.
    minimumAccessRightLevelToReadFormData="Edit"
  • Suitable values for minimumAccessRightLevelToReadFormData are as follows:
    NoAccess = 0, Read = 1, Create = 2, Edit = 4, Delete = 8, Publish = 16, Administer = 32, FullAccess = 63
    

    For example, if you change the access rights to Publish, only a user whose has Publish, Administer and FullAccess access rights on that form can see the SubmissionData.

  • Send email in HTML format, otherwise, it uses plain text.
    sendMessageInHTMLFormat="true"
  • By default, the FileUploadElement does not let a visitor upload the following types of file extensions.
    defaultUploadExtensionBlackList="asp,aspx,asa,ashx,asmx,bat,chm,class,cmd,com,config,dll,exe,hta,htr,htw,jse,json,lnk,mda,mdb,msc,msh,pif,printer,ps1,ps2,reg,rem,scf,scr,sct,shtm,shtml,soap,stm,svc,url,vb,vbe,vbs,vsix,ws,wsc,wsf,wsh,xamlx,htm,html,js,jar"
  • Episerver Forms is block-based and stays in a page. Without JavaScript, Forms post data from a visitor to its page. With JavaScript, Forms post data from a Visitor to its CoreController. EPiServer.Forms.Controllers.DataSubmitController is the default CoreController, which is a normal ASP.NET MVC controller. If you want to use your own controller, you must map the route in Global.asax to your controller, and tell Forms to submit data to your controller by changing the following configuration.
    coreController="/EPiServer.Forms/DataSubmit" 
  • Specify the default location to search for ElementBlocks' view templates. A developer also can override this behavior by implementing ICustomViewLocation or inheriting from CustomViewLocationBase.
    formElementViewsFolder="~/Views/Shared/ElementBlocks"
    
  • Forms detects JavaScript capability of browser to determine its behavior.
    • Using a HTML5 JavaScript-enabled browser, visitor has better (and rich UI) experience.
    • Working with non-JavaScript browser, Forms has to use server-side redirection and disable some feature (interaction, validation, ...).

    In some situations, you can force Forms to work in non-JavaScript environment by setting this configuration to true.

    workInNonJSMode="false"
    
  • Forms requires jQuery 1.7.2+ to provide better experience in ViewMode (interaction, steps navigation, validation, save/load data to localStorage, …). If your website already has jQuery 1.7.2+, you can save some payload and network transmission for your visitor by telling Forms to not inject its jQuery instance. Forms uses the site’s jQuery instance without problem.
    injectFormOwnJQuery="true"
    
  • Forms has a default stylesheet (EPiServerForms.less), using BEM methodology to name CSS classes and decorate HTML element tags; it is a very fundamental, minimal .less file, and easy to modify. If you do not want this, you can turn it off by using the following configuration.
    injectFormOwnStylesheet="true"
  • Configuration for number of days that Forms keeps the state of relation (in visitor's cookie) between Visitor-Forms-Submission. This affects the progressive submission cookie, and the visitor identification cookie.
    visitorSubmitTimeout="90"
  • By default, a form is rendered as a <form> tag in view mode. From version 3.1, if you want to render form as a <div> tag, set this configuration to true.
    renderingFormUsingDivElement="true"
  • From version 4.3, you can set up the kind of data format used before sending data to a webhook receiver by using:

    serializingObjectUsingNameValueFormat="true"

    The default value of this key is true, meaning you should use that json object data-type to communicate with webhook receivers. The key-value dictionary data format is used if you use the value false.

Configuring mail

To send email after a site visitor submits a form, modify the following web.config settings for your website.

<system.net>
    <mailSettings>
      <!--<smtp deliveryMethod="PickupDirectoryFromIis" >-->
      <!-- Common usage is to use other network existing mail server other than
                 IIS Virtual SMTP Server. 
                 In such cases use the commented settings below with your server
                 location and authentication credentials.
                 -->
    <smtp from="mail@episerver.com" deliveryMethod="Network">
        <network host="sample.xx.yy" port="25" />            
      </smtp>
    </mailSettings>
  </system.net>

See also Configuring your email server.

Comments