Customizing Form Appearance and Functionality using JavaScript

  • Updated

If you routinely use the Act-On Form editor, you may want to customize the appearance or functionality of Forms beyond what the editor allows by default. With some CSS and JavaScript knowledge, just about any edit can be made.

  1. Go to Content > Forms.
  2. Hover over the Form in question and click Edit  
  3. In the Design tab, click CSS:

Customizing Form Appearance and Functionality using JavaScript 01.png

  1. From this panel, you can modify the various classes utilized by Act-On Forms.

Modify Form Functionality with JavaScript

If you are embedding a Form on a Landing Page, you can use JavaScript on the landing page to target specific areas of the Form and change how they function. Because Forms are generated on-demand for each visitor, they load separately from the rest of the page – this means that code must be entered correctly to ensure it runs after the Form is loaded.

Custom code can cause issues and should only be applied by professional web developers.

To target Forms embedded on Act-On Landing Pages:

  1. Create your Form and embed it on an Act-On Landing Page as described here.
  2. In the Landing Page Composer, navigate to the Edit Form Block section.
  3. Click on the Form Load JS tab and add your code:

Customizing Form Appearance and Functionality using JavaScript 02.png

  1. Click OK to save.
If your Form is set to redirect to an external URL, Classic Form, or Act-On Landing Page on submit, then any code you want to run once the Form is submitted can be added directly to those pages.
  • To apply code once a Form is submitted and redirects to a Rich Text Block (or Saved Rich Text Block), add your code in the ‘Form Submit JS’ tab:

Customizing Form Appearance and Functionality using JavaScript 03.png

If you have highly-customized requirements for your web Forms or have existing web Forms you would like to use with Act-On rather than using Act-On-generated Forms, please see the article Posting External Forms to Act-On.

Was this article helpful?

Have more questions? Submit a request