Setting up a Custom Code Form

Requires Pro Plus or higher

  1. Click Add Element

  2. Click Form to create a new Form element.

  3. Set Type to Custom, then Run Code.

  4. Enter the Code you'd like to run. Use this to interface with the underlying DOM element. Return a value of true or explicitly call success() to trigger a Success response. Return a value of false or explicitly call failure() to trigger a Failure response. Omit a return value to trigger neither response.

  5. Click Fields

  6. Click the first field (labeled "Untitled") to expand it.

  7. Assign the field a short, descriptive Label. This label will appear either within the field itself or directly above it (depending on how you've styled your form).

  8. Set the field's Type. The following types are currently supported:

    TextAccepts a short, single line of text.
    EmailAccepts a valid email address (eg. user@domain.ext).
    Text AreaAccepts multiple lines of text.
    SelectAccepts a single option chosen from a dropdown menu.
    CheckboxAccepts either a "checked" or "unchecked" state.
    PhoneAccepts a valid phone number.
    NumberAccepts a valid integer, decimal or currency value.
    DateAccepts a valid date (eg. 2016-03-07). When clicked, opens the browser's native date picker dialog.
    FileAccepts a single file upload (up to 16MB).
    HiddenAccepts a single line of predefined text.
  9. (Optional) Configure any options specific to the field's type.

  10. (Optional) Check Optional to make the field optional.

  11. (Optional) Assign the field an ID. If omitted, an ID will be automatically generated based on the field's label.

  12. (Optional) Assign the field a Default Value.

  13. Click Add to add additional fields, repeating steps 7 through 12 for each.

  14. With the form's fields now in place, click back to Form

  15. (Optional) Choose an On Success behavior.

  16. (Optional) Choose an On Failure behavior.

  17. (Optional) Click the Button tab and change the form's submit button Label.

  18. (Optional) Check Collect UTM parameters to automatically include all detected UTM parameters as additional fields. The following fields will be populated if detected: utm_source, utm_medium, utm_campaign, utm_term, and utm_content.

  19. You're done! The site should now have a fully functional custom code form.