Please sign in to get the most from this site.

Integrating an Act-On Form External Post with WordPress



1 comment

  • Avatar
    Adal Bermann

    The javascript provided for the #_Standard_Implementation:_Page_Method is not working properly because it relies on window.onload.

    This article explains why that is a problem:

    Below is my revised script, including a conditional statement to avoid it being printed elsewhere than on the relevant Thank You pages.
    Note also that I included the ActOn form External Post URL as a query string in the Gravity Form's Confirmation settings. This allows the use of a single script in your theme files to submit different forms to Acton. You'll want to encode the URL using this tool:

    if (is_page([5,18,20])) { ?>
    <script type="text/javascript">
    var aoExternalPostURL = "<?php echo $_GET["acton_url"]; ?>";
    function actonSubmit() {
    if (String(window.location).search("%40")>0) {
    var aoUrlParams; var aoQuery =;
    (window.onpopstate = function () {var e, t = /([^&=]+)=?([^&]*)/g;
    aoUrlParams = {};
    while (e = t.exec(aoQuery)) aoUrlParams[encodeURIComponent(e[1])] = e[2]})();
    for (i in aoUrlParams) {var aoUrlParamsArray = aoUrlParams[i];
    try {document.getElementsByName(i)[0].value = decodeURIComponent(aoUrlParamsArray)}
    catch (err) {}
    var aoIfrm = document.createElement("iframe");
    aoIfrm.setAttribute("id", "ifrm"); = "transparent"; = "none"; = "1px"; = "1px";
    aoIfrm.src = aoExternalPostURL + "?" + aoQuery;
    window.addEventListener ?
    window.addEventListener("load",actonSubmit,false) :
    window.attachEvent && window.attachEvent("onload",actonSubmit);
    <?php } ?>
    Comment actions Permalink

Please sign in to leave a comment.

Looking for more help?