Formidable Multistep Form

Home Forums WP Armour – Honeypot Anti Spam Formidable Multistep Form

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #537377 Reply
    HostPress GmbH
    Participant

    I use Formidable and a multistep form there. This means that input fields are spread across several slides.
    In the first slide, the fields wpa_field_name and alt_s are still set, but in the last step, these two fields are no longer there.
    Could it be that WPArmour is not yet compatible with Formidable multistep forms?

    I solved the problem like this 🙂
    In this case, using an observer, because the elements are all generated very dynamically.

    jQuery(document).ready(function($){
    var wpaFields = [];

    const observer = new MutationObserver(function(mutationsList, observer){
    for(let mutation of mutationsList){
    if($(‘form.frm-show-form .frm_rootline_group’).length > 0){
    var form = $(‘form.frm-show-form’);
    var formToken = form.attr(‘data-token’);
    if(wpaFields[formToken] == undefined){
    wpaFields[formToken] = false;
    }
    if($(‘#altEmail_container’, form).length > 0 && $(‘.wpa_hidden_field’, form).length > 0 && wpaFields[formToken] == false){
    wpaFields[formToken] = $(“#altEmail_container”, form)[0].outerHTML + ” + $(“.wpa_hidden_field”, form)[0].outerHTML;
    } else if($(‘#altEmail_container’, form).length == 0 && $(‘.wpa_hidden_field’, form).length == 0 && wpaFields[formToken] != false){
    form.append(wpaFields[formToken]);
    }
    }
    }
    });

    observer.observe(document.documentElement, {
    childList: true,
    subtree: true
    });
    });

Viewing 1 post (of 1 total)
Reply To: Formidable Multistep Form
Your information: