• Resolved howardlipt

    (@howardlipt)


    Hello,

    I am troubleshooting erratic behavior with Contact Form 7’s [response] messages.

    The developer of the Contact-form-7-popup-message plugin looked at the problem and believes that “The problem is with Avada theme, it is replacing contact form 7 messages with its own custom CSS.”

    He suggested replacing script.js in the plugins directory with the following code.

    Can anyone take a look and tell me if there is a way to apply this fix to Contact Form 7’s own js directory? I’d like to fix the problem closer to the source if possible.

    Thank you so much for taking the time to look:

    (function ($) {
    ‘use strict’;
    jQuery(“.wpcf7-submit”).on(“click”, function (event) {
    var formdiv = $(this).closest(‘form’).parent(‘div’).prop(‘id’);
    var wpcf7id = $(this).closest(‘form’).find(‘input[name=_wpcf7]’).val();
    var ajax_url = obj_variable.pma_template_Url+’/wp-admin/admin-ajax.php’;
    //alert(ajax_url);
    $(“.wpcf7-response-output”).hide();
    jQuery.post(
    ajax_url,
    {
    action:’checkPMAenable’ ,
    data:wpcf7id
    },
    function(response){
    //alert(wpcf7id);
    //alert(response);
    var json = $.parseJSON(response);
    if(json.pma==1)
    {
    setTimeout(function () {
    //var formdivid = ‘div#’+formdiv+’ .wpcf7-response-output’;
    var formdivid = ‘div#’+formdiv+’ .fusion-alert-content’;

    var cls = $(formdivid).html();

    $(formdivid).hide();
    var msg_alert = $(formdivid).html();
    //alert($(formdivid).attr(‘class’));
    if($(formdivid).hasClass(“wpcf7-validation-errors”))
    {
    //swal({ title: msg_alert, text: “”, type: “error”, confirmButtonText: “OK” });
    swal(msg_alert, “”, “error”);
    }
    else if($(formdivid).hasClass(“wpcf7-mail-sent-ok”))
    {
    swal(msg_alert, “”, “success”);
    }
    else{
    swal($(formdivid).html(), “”, “error”);
    }
    }, 2000);

    }

    });
    });
    })(jQuery);

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Response message and Avada theme’ is closed to new replies.