0

Link is there: http://lavii.ee/proov Contact form isnt working properly.

As contact form 7 refers- it seems to be ajax error. Cant figure out what exactly is wrong there...

HackerKarma
  • 620
  • 7
  • 18
  • There is nothing wrong I can see there . It is working ok , confirmation and all. It is just quite slow . – Obmerk Kronen Feb 24 '14 at 14:29
  • Actually its not. There are two things- 1) It adds #wpcf7-f4-p2-o1 into the website url end 2) It refreshes the page (it shouldnt) And a third one 3) When i try to use the following link which is supposed to redirect the page, it wont work. on_sent_ok: "location = 'http://example.com/';" Oh, and there is no spinning arrows if we compare it to [this](http://contactform7.com/why-isnt-my-ajax-contact-form-working-correctly/) – Karlfromtheisland Feb 24 '14 at 20:46
  • Dude.. Next time , please do elaborate a bit . just saying "not working" is not enough.. People here can not guess what is wrong. Please add the code ( form fields from wpcf7 ) or something more to work with ... For end users just submitting the form works . – Obmerk Kronen Feb 25 '14 at 02:38

1 Answers1

0

There are many things that can cause the errors you have described ( in the comments ) above.

one of them is the missing wp_footer() , wp_header() functions in header and footer respectively , but if you did not manually removed them , they are included in foundation.

Another reason is wrong loading of js /jQuery. which is probably the case with your theme since indeed it seems the wpcf7 script is not loading ..

The wp-foundation theme is actually using a very bad practice of deregistring wp own jQuery and loading a "personal" version.

I can not even start to enumerate the reasons why it is wrong .

While not 100% sure , It is probably one of the reasons ( if not THE reason )

the code is in functions.php

/************* ENQUEUE JS *************************/

/* pull jquery from google's CDN. If it's not available, grab the local copy. Code from wp.tutsplus.com :-) */

$url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; // the URL to check against  
$test_url = @fopen($url,'r'); // test parameters  
if( $test_url !== false ) { // test if the URL exists  

    function load_external_jQuery() { // load external file  
        wp_deregister_script( 'jquery' ); // deregisters the default WordPress jQuery  
        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'); // register the external file  
        wp_enqueue_script('jquery'); // enqueue the external file  
    }  

    add_action('wp_enqueue_scripts', 'load_external_jQuery'); // initiate the function  
} else {  

    function load_local_jQuery() {  
        wp_deregister_script('jquery'); // initiate the function  
        wp_register_script('jquery', bloginfo('template_url').'/javascripts/jquery.min.js', __FILE__, false, '1.7.2', true); // register the local file  
        wp_enqueue_script('jquery'); // enqueue the local file  
    }  

    add_action('wp_enqueue_scripts', 'load_local_jQuery'); // initiate the function  
}  

The right code should simply be

   function load_local_jQuery() {  

        wp_enqueue_script('jquery'); // enqueue the local file  
    }  

    add_action('wp_enqueue_scripts', 'load_local_jQuery'); // initiate the function  

to load wp own jQuery ...

See also here and here

Also, disable all other plugins when testing and make sure you use the latest release for both wpcf7 and wp itself ...

Community
  • 1
  • 1
Obmerk Kronen
  • 15,619
  • 16
  • 66
  • 105