Loading...
Skip navigation
Please note that this documentation is for the most recent version of this extension. It may not be relevant for older versions. Related documentation can be found in the documentation directory of the extension.

Override JavaScript functionality

In case of that some JavaScript section needs to be modified, you can override the related method simply like following example:

DoubleOptinDownload.showLoadingInfo = function (formUid) {
    document.querySelectorAll(`#download-form-${formUid} input`).forEach(el => el.disabled = true);
    document.querySelectorAll(`#download-form-${formUid} button`).forEach(el => el.disabled = true);
};
DoubleOptinDownload.hideLoadingInfo = function () {
    document.querySelectorAll('.tx-double-optin-download input').forEach(el => el.disabled = false);
    document.querySelectorAll('.tx-double-optin-download button').forEach(el => el.disabled = false);
};
DoubleOptinDownload.refreshFormFeedback = function (response) {
    Object.keys(response.form).forEach(key => {
        const field = document.getElementById(`download-${key}-${response.uid}`);
        if (!field) return;
        const wrapper = field.closest('.form-group');
        const feedback = wrapper && wrapper.querySelector('.invalid-feedback');
        field.classList.remove('is-invalid', 'is-valid');
        if (response.form[key].isValid) {
            if (feedback) feedback.innerHTML = '';
            field.classList.add('is-valid');
        } else {
            if (feedback) feedback.innerHTML = response.form[key].error;
            field.classList.add('is-invalid');
        }
    });
};
DoubleOptinDownload.clearForm = function (response) {
    Object.keys(response.form).forEach(function(key) {
        const field = document.getElementById(`download-${key}-${response.uid}`);
        if (!field) {
            return;
        }
        const type = field.type;
        const node = field.nodeName;
        if (type === 'text' || type === 'tel' || type === 'email') {
            field.value = '';
            field.classList.remove('is-valid');
        }
        else if (type === 'checkbox') {
            field.checked = false;
            field.classList.remove('is-valid');
        }
        else if (node === 'SELECT') {
            field.selectedIndex = 0;
            field.classList.remove('is-valid');
        }
    });
};
Documentation
TYPO3 Double-Optin-Download Extension

TYPO3 Double Optin Download

The Double-Optin-Download extension allows you to setup your downloads so that visitors fill out an inquiry form and then get a download link via email. They can download the files using the link exactly once.

Menu

Contact request

You can contact us at any time

Stop! Playing in the meantime?
Stop! Playing in the meantime?
Stop! Playing in the meantime?

Stop! Playing in the meantime?

Break the highscore

Press Start
Contact request
Screenreader label
Security question
W3U_________NTM______
__G____K____D_____RZT
TED___C6A___U8M______
__S____Z______N___HBZ
845_________SWK______