You can set Act-On's Forms to auto-submit by adding a snippet of JavaScript. Use auto-submit for hidden Forms on your Act-On Landing Pages to capture a variety of user information, including double opt-ins, NPS feedback, event confirmation, and more.
Instructions
Add JavaScript to a Landing Page
You cannot add JavaScript directly to an Act-On Form. Instead, you'll need to add any code to the Landing Page that hosts your Form. Once you've designed your Form and embedded it on a Landing Page, follow these steps to enable auto-submit:
- Go to Content > Landing Pages.
- Find the Landing Page hosting your Form, hover over it and Edit to open the Landing Page composer.
- Go to the Design tab.
- In the right-hand Settings panel, click Edit JavaScript:
-
Paste the following code snippet into the Edit JavaScript field:
<script>
aoPostLoadCallback = function(){ document.querySelector(".ao-form-submit").click(); document.querySelector(".ao-form").style.display = "none"; }
</script> - Click OK.
- Save the Landing Page.
Add JavaScript to Classic Forms
You can add JavaScript/jQuery directly to Act-On's Classic Forms. Follow the steps below to enable your Classic Form to auto-submit when the Form loads:
- Go to Content > Forms.
- Create a new Classic Form or Edit an existing Classic Form.
- Go to the Settings tab.
- Scroll down to the External Web Analytics Support field and paste the following code snippet:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><script> jQuery.noConflict(); jQuery(document).ready(function ( $ ) { $("input[name='Submit']").click(); });</script>
- Click Next at the top of the screen.
- Save the Classic Form.