Follow

Calling back after the certificate is inserted into your form

 

Publishers may find it useful to have a callback fire after the TrustedForm script has inserted the certificate URL into the form. TrustedForm supports this option by calling the global function named trustedFormCertIdCallback with a single argument, the TrustedForm certificate ID. The trustedFormCertUrlCallback is also available if you want the full certificate URL rather than just the ID.

In order to implement this callback, you must define the function trustedFormCallback before loading the TF script.

For example, this script will pop up an alert box with ID of the TrustedForm Certificate.


    // the callback
    <script type="text/javascript">
      function trustedFormCertIdCallback(certificateId) {
        alert("Certificate ID: " + certificateId);
      }
      function trustedFormCertUrlCallback(certificateUrl) {
        alert("Certificate URL: " + certificateUrl);
      }
    </script>

    // the TrustedForm script wrapped in a function
    <script type="text/javascript">
    (function() {
    /*Place the core TrustedForm Script here

    Obtain the core script by signing up at

    http://activeprospect.com/products/trustedform/#integrate-tf

    */

    })();
    </script>
    </script>

 

Please note, these callbacks are only fired once, regardless of how many forms the TF inserts the certificate URL into.

Each callback is strictly optional and can safely be ignored. If the callback functions are not defined, then the callback feature is ignored by the TrustedForm script.

Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

Comments

You must be logged in to comment.