---
title: "jQuery not defined – Gravity Forms"
url: https://byaman.com/jquery-not-defined-gravity-forms/
description: "Fix the \"jQuery is not defined\" error in Gravity Forms when a form is embedded outside the WordPress loop, using gravity_form_enqueue_scripts()."
author: "Amandeep"
published: 2020-03-02
last_modified: 2020-03-02
categories: ["Personal"]
---

# jQuery not defined – Gravity Forms

Some solutions are given here: [JS error on Gravity Forms (Stack Overflow)](https://stackoverflow.com/questions/23786388/js-error-on-gravity-forms)  
  
If we are embedding gravity form in template files and form is outside wp loop, then we need to call **gravity\_form\_enqueue\_scripts( $form\_id, $is\_ajax );** function to force stylesheets and scripts to load in the header.  
Documentation: [gravity_form_enqueue_scripts() documentation](https://docs.gravityforms.com/gravity_form_enqueue_scripts/)
