jQuery not defined – Gravity Forms - Wordpress. New entries not created. How to fix?

Explanation --- When you put your gravity form to pages where the header is not loaded using Wordpress standards. Like Elementor or similar visual builders you can have these errors:

After pressing Submit in form you can have errors in browser console like this: jQuery not defined

It means that script and styles for gravity forms not loaded on this page so just do it!

Just use Gravity Forms examples:

https://docs.gravityforms.com/gravity_form_enqueue_scripts/#h-examples

or use code and fix code for your needs:

function gf_enqueue_required_files() {
    GFCommon::log_debug( __METHOD__ . '(): running.' );
    if ( is_page('1') ) { // Only for a page with ID 1.
        gravity_form_enqueue_scripts( 5, true ); // Form ID 5 with ajax enabled.
    }
}
add_action( 'get_header', 'gf_enqueue_required_files' );

Done

Метаданные статьи

Идентификатор статьи:
128
Категория:
Дата добавления:
28.02.2024 18:24:39
Просмотры:
2,974
Рейтинг (Голоса):
(0)

Связанные статьи