Email footer form not working

I set up an email form for my footer, but nothing happens when I click the signup button. And when you click the signup button the circle with a slash symbol pops up. Website is soundofusproject.com.

Hi There,

Please try testing for a plugin conflict first. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

If you have a caching plugin installed, please clear all caches before deactivating all third party plugins.

If you have a CDN setup, please disconnect your site from it momentarily.

Thanks.

I turned off all of the plugs ins and it still doesn’t let me submit an email. However, when I turned off the WP-SpamShield plug in I did get this different error message:

MailChimp Error: The requested resource could not be found.

I also tried disconnecting and reconnecting my MailChimp account and setting up a new footer email form, but the issue remains.

Hi There,

Would you mind providing us with login credentials so we can take a closer look? I am seeing a JS error on the console. Please provide following information:

Set it as Secure Note

  • WordPress Admin username / password

All the best!

details removed by staff

Hello There,

Are you referring to this form?

I inserted an email address and hit subscribe buttons. It then leads to this:

After a few seconds, it displays a message (https://prnt.sc/fys2df) and disappeared.

Please check it again.

No, it’s the email form in the footer. See attached screen shot.

Hi there,

I accessed your website and tried different tests and could not find the culprit. I see that you used the email forms widget to add it to the footer Builder. I suggest that you copy the shortcut of the form and use the text element of the form builder to add the subscription form. See if that fixes the problem, I could not do that because it seems your site is live.

Thank you.

I did that, but it’s the same issue where the circle with the slash shows up when you try to click the Sign Up button and nothing happens.

Hi again,

Try this, via FTP navigate to /wp-content/plugins/tco-email-forms/email-integration/js/site/main.js and open main.js file, replace the entire code with the following code:

// =============================================================================
// EMAIL-INTEGRATION/JS/SITE/MAIN.JS
// -----------------------------------------------------------------------------
// Plugin site scripts.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Handle Form Submissions
// =============================================================================

// Handle Form Submissions
// =============================================================================

jQuery(document).ready(function($) {

  function confirm_subscription( form ) {

    var confirm_type = form.data('tco-email-confirm');

    if ( confirm_type === 'Message' ) {
      make_alert( form.data('tco-email-message'), 'tco-alert-success' ).appendTo(form);
    }

    if ( confirm_type === 'Redirect' ) {
      window.location.href = form.data('tco-email-redirect');
    }

  }

  function make_alert( content, class_name ) {

    return $('<div class="tco-subscribe-form-alert-wrap">' +
               '<div class="tco-alert ' + ( class_name || 'tco-alert-danger' ) + ' fade in man">' +
                 '<button type="button" class="close" data-dismiss="alert">&times;</button>' +
                 content +
               '</div>' +
             '</div>').alert();

  }

  function nameIntoArray( name, value ) {
    if ( typeof name === 'object' ) {
      return  nameIntoArray( name, value );
    }
    return value;
  }


  $('.tco-subscribe-form').submit(function(e) {

    //
    // Prevent default behavior.
    //

    e.preventDefault();

    //
    // Remove old alerts
    //

    $('.tco-subscribe-form-alert-wrap').remove();

    //
    // Make note of our form.
    //

    $form = $(this);


    //
    // Prevent extra submissions.
    //

    $form.find('input[type="submit"]').prop('disabled', true).addClass('btn-muted');


    //
    // Craft data for AJAX request.
    //

    var data = $form.serializeArray().reduce(function(obj, item) {

      var iname = item.name.match(/\[(.*?)\]/g);
      $.each(iname,  function ( index, value ) {
        iname[ index ] = value.replace('[', '').replace(']', '').replace('-', '_');
      });
if(iname !== null) {


      switch ( iname.length ) {

        case 4:
          if ( typeof obj[ iname[0] ] === 'undefined' ) {
            obj[ iname[0] ] = {};
          }
          if ( typeof obj[ iname[0] ][ iname[1] ] === 'undefined' ) {
            obj[ iname[0] ][ iname[1] ] = {};
          }
          if ( typeof obj[ iname[0] ][ iname[1] ] === 'undefined' ) {
            obj[ iname[0][ iname[1] ][ iname[2] ] ] = iname[3] === '' ? [] : {};
          }
          if ( iname[3] === '' ) {
            obj[ iname[0] ][ iname[1] ][ iname[2] ].push( item.value || '' );
          } else {
            obj[ iname[0] ][ iname[1] ][ iname[2] ][ iname[3] ]= item.value || '';
          }
          break;

        case 3:
          if ( typeof obj[ iname[0] ] === 'undefined' ) {
            obj[ iname[0] ] = {};
          }
          if ( typeof obj[ iname[0] ][ iname[1] ] === 'undefined' ) {
            obj[ iname[0] ][ iname[1] ] = iname[2] === '' ? [] : {};
          }
          if ( iname[2] === '' ) {
            obj[ iname[0] ][ iname[1] ].push( item.value || '' );
          } else {
            obj[ iname[0] ][ iname[1] ][ iname[2] ]= item.value || '';
          }
          break;

        case 2:
          if ( typeof obj[ iname[0] ] === 'undefined' ) {
            obj[ iname[0] ] = iname[1] === '' ? [] : {};
          }
          if ( iname[1] === '' ) {
            obj[ iname[0] ].push( item.value || '' );
          } else {
            obj[ iname[0] ][ iname[1] ]= item.value || '';
          }
          break;

        case 1:
          if (iname[0] === 'id') {
            iname[0] = 'form_id';
          }
          if (iname[0] === 'email') {
            iname[0] = 'email_address';
          }
          obj[ iname[0] ] = item.value || '';
          break;
      }
      }

      return obj;
    }, {});

    postdata = {
      action : 'tco_subscribe',
      data   : data
    };

    //
    // Submit form.
    //

    $.post(email_forms.ajax_url, postdata, function(response) {
      data = $.parseJSON(response);
      if ( data.error ) {
        make_alert(data.message).appendTo($form);
        $form.find('input[type="submit"]').prop('disabled', false).removeClass('btn-muted');
      } else {
        confirm_subscription($form);
      }
    });

  });

});

Save the file, make sure the old file is replaced with the new file that you edited.

This should fix the issue, let us know how this goes!

That didn’t change anything. Any other suggestions?

Hi again,

It was the cache issue, I went ahead and cleared your plugin’s cache and tested the form and it worked just fine (see screenshot)

Please clear your browser’s cache now and test the form again. Always make sure to purge the entire cache after making any change or if your site is under development then disabled the cache plugin so you can see the changes right away,

Cheers!