Support » Plugin: Contact Form 7 » Latest version 5.4 breaking ajax form

  • Hello,

    Before the latest version 5.4 below code is working fine for ajax content with contact form shortcode but in the latest version, it throws error Uncaught TypeError: wpcf7.initForm is not a function

    
    $( 'div.wpcf7 > form' ).each( function() {
    	var $form = $( this );
    		wpcf7.initForm( $form );
    
    	if ( wpcf7.cached ) {
    		wpcf7.refill( $form );
    	}
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • iamwpuserormaybenot

    (@iamwpuserormaybenot)

    I had problems too. Got an error with wpcf7 and multistep form together said that: wp-admin/admin-ajax.php?action=cf7mls_validation server 500. Debugged down to latest update and then made rollback to 5.3 and it worked again. Please fix 5.4, it’s frustrating when auto-updates are on and clients can’t contact.

    Same issue here… Still happening 3 months later.

    Erik

    (@codekraft)

    hi @mukesh27 where you find that function? Is it wrong how can it work?
    use is wpcf7.init (wpcf7.initForm was outdated) if needed.

    $( 'div.wpcf7 > form' ).each( function(wpcf7) {
      var $form = $( this );
      $form.init( $form );
    
      if ( $form.cached ) {
        $form.refill( $form );
      }
    });

    But I want to advise that if the cache is active wpcf7 reloads itself automatically so do this is useless/wasting time

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.