Tracking forms with non standard submission

Overview
Modern websites employ a myriad of different form types and submission methods, therefore, in order for ClickTale to capture accurate data for its Form Analytics reports, some fine-tuning is required to account for the different scenarios that occur on the Web.

Form Characteristics:
In order to capture accurate form data for ClickTale's form analytics tool, ClickTale relies on the fulfillment of several preconditions to capture form submission attempts as well as distinguish between successful submissions and those that fail.

For ClickTale's purposes, two considerations matter most when considering what integration to use:
 * The nature of the submission element and
 * The submission mechanism itself,

Each is divided into two categories: 1. Submission element: Standard vs. Non-Standard.
 * This distinction is made because only the Standard submission elements trigger a "submit" event, which is how ClickTale detects that a visitor tried to submit the form.
 * These elements are &lt;input type='submit'&gt;, &lt;input type='image'&gt; or &lt;button type='submit'&gt;.
 * Any other variant, such as &lt;button type='button'&gt;, &lt;a href&gt; or &lt;span&gt; do not generate this event and thus require a workaround to make ClickTale aware of the fact that a submission attempt occurred.

2. Standard POST/GET Submission method vs. submissions done via AJAX:
 * One of the pre-conditions for ClickTale's recognition of a successful form submission is the transition to a different page within a short period of time (a few seconds).
 * However, when AJAX technology is used to submit the form, the submission is not followed by a transition to a different page (and the page "unload" event), thus necessitating a workaround to indicate to        ClickTale that the form was, in fact, submitted, even if the aforementioned precondition was not met.

ClickTaleRegisterFormSubmit - Forcing a Submit Event
If your form's submission element is not one of the following - &lt;input type='submit'&gt;, &lt;input type='image'&gt; or &lt;button type='submit'&gt; - then we can let ClickTale know that a submit attempt took place on the page by using the following Form Submission API. This is done by listening to a 'click' event on the submit element, and registering a ClickTale 'submit attempt' on the actual form when that happens. On our part, we only need to add the submit element and the form's selectors. For the example below, we'll assume that the submit element is a &lt;span&gt; with an ID of 'submitElement', and the form's ID is "someForm":

Telling Successful and Failed Submissions Apart (Using ClickTale Events):
If your form is submitted via AJAX, you can use the following ClickTale Event to indicate to ClickTale that Server-Side Validation was successful or failed.

Make sure to call this Event after the AJAX response has returned (commonly inside the callback function):

Or, if Server-Side Validation has failed, you should pass the "form_submit_fail" ClickTale Event:

Advanced
Although rare, in some instances (such as credit card and log-in forms), a failed submission still includes a page reload, which ClickTale treats as a successful submission by default. Therefore, it is only necessary to tell the failed submissions apart from the rest.

To achieve this, the ClickTaleRegisterFormSubmitFailure function should be executed on the response page following the failed form submission: