• Hi, I’m building this site and I been getting this error: “Uncaught TypeError: wpcf7.initForm is not a function” after an AJAX page transition (navigate to another section with the menu).
    I’ve used the plugin in many sites with a similar behavior but I’m getting the error only here. Also, it only happens the first time you go to another section, when you try again without reloading it works well.

    The form is inside a hidden div that is shown when pressing “Contacto” in the nav menu.

    Any idea what could it be?

    Thanks in advance! Love the plugin, a must in everysite I make.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    What other plugins and theme do you use on the site?

    Thread Starter Nicolas Landgraf

    (@nicolas-landgraf)

    For the theme I use a custom one usually, but it doesn’t have anything to be honest, in functions.php I mostly enqueue a few libraries to be used:

    function nlmd_styles_scripts() {
    
      wp_enqueue_script('jquery');
    
      wp_enqueue_style( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', array(), '1.1', 'all');
    
      wp_enqueue_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', array ( 'jquery' ), 1.1, true);
    
      wp_enqueue_style( 'slick', 'https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.css', array(), '1.1', 'all');
      wp_enqueue_script( 'slick', 'https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js', array ( 'jquery' ), 1.1, true);
    
      wp_enqueue_script( 'smoothstate', 'https://cdn.jsdelivr.net/npm/[email protected]/src/jquery.smoothState.min.js', array ( 'jquery' ), 1.1, true);
    
      wp_enqueue_style( 'GoogleFonts', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400&display=swap', array(), '1.1', 'all');
    
      wp_enqueue_script( 'smoothstatejs-scripts', get_stylesheet_directory_uri() . '/js/smoothstatescripts.js', array ( 'jquery' ), 1.1, true);
    
      wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    add_action( 'wp_enqueue_scripts', 'nlmd_styles_scripts' );

    And then I work on the header.php , footer.php , etc. but not much code is involved.

    Plugins:
    Advanced Custom Fields PRO
    Advanced Custom Fields: ACF Code Field
    Contact Form 7
    Custom Post Type UI
    Editor Full Width Gutenberg
    LuckyWP ACF Menu Field
    SG Optimizer
    SVG Support
    TinyMCE Advanced

    I tried disabling all of them except CF7 but the issue remained.

    For the AJAX transition I use “smoothState.js”.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Try switching to the default theme and deactivating all plugins excluding Contact Form 7.

    Why you are advised to deactivate plugins and switch to the default theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error “wpcf7.initForm is not a function” after AJAX page transition’ is closed to new replies.