skip to Main Content

I get a message An error occurred. from elementor form when i submit my elementor form.
I configured the Actions after submit with a webhook to a custom url.
I don’t know if the problem is my hook function not responding as it should.

Configuration : After Form Submit

Configuration : WebHook

The error message after the submition

I should point out that when I remove the webhook from the Actions after submit list, I no longer get this error.

2

Answers


  1. Chosen as BEST ANSWER

    I understood the problem

    My custom url was not responding correctly, I added return json_encode(array("success"=>true)); to the end of the callback function and that solved the problem.


  2. I had a similar issue, I also got an Elementor Forms error message, which turned out to be a timeout issue.

    By default, the timeout is set to only 5 seconds. This can be increased by using an add_filter in PHP. For example, if you are using make.com as the webhook, you can specify:

    add_filter('http_request_timeout', function($timeout, $url = '') {
        $start_with = 'https://hook.us1.make.com';
        
        //return is_string($url) && str_starts_with($url, $start_with) // PHP 8
        return is_string($url) && strncmp($url, $start_with, strlen($start_with)) === 0 // PHP 7 or older
            ? 30 // TODO: set appropriate timeout, WordPress default is 5 seconds
            : $timeout; // return unchanged url for other requests
    }, 10, 2);
    

    See the original issue here:
    https://github.com/elementor/elementor/issues/20452

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search