Setting up a Custom Code Form
Requires Pro Plus or higher
Click Add Element
Click Form to create a new Form element.
Set Type to Custom, then Run Code.
Enter the Code you'd like to run. Use
this
to interface with the underlying DOM element. Return a value oftrue
or explicitly callsuccess()
to trigger a Success response. Return a value offalse
or explicitly callfailure()
to trigger a Failure response. Omit a return value to trigger neither response.Click Fields
Click the first field (labeled "Untitled") to expand it.
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).
Set the field's Type. The following types are currently supported:
Text Accepts a short, single line of text. Email Accepts a valid email address (eg. user@domain.ext
).Text Area Accepts multiple lines of text. Select Accepts a single option chosen from a dropdown menu. Checkbox Accepts either a "checked" or "unchecked" state. Phone Accepts a valid phone number. Number Accepts a valid integer, decimal or currency value. Date Accepts a valid date (eg. 2016-03-07
). When clicked, opens the browser's native date picker dialog.File Accepts a single file upload (up to 16MB). Hidden Accepts a single line of predefined text. (Optional) Configure any options specific to the field's type.
(Optional) Check Optional to make the field optional.
(Optional) Assign the field an ID. If omitted, an ID will be automatically generated based on the field's label.
(Optional) Assign the field a Default Value.
Click Add to add additional fields, repeating steps 7 through 12 for each.
With the form's fields now in place, click back to Form
(Optional) Choose an On Success behavior.
(Optional) Choose an On Failure behavior.
(Optional) Click the Button tab and change the form's submit button Label.
(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
, andutm_content
.You're done! The site should now have a fully functional custom code form.