Title: Uncaught ReferenceError: html_forms is not defined
Last modified: April 17, 2023

---

# Uncaught ReferenceError: html_forms is not defined

 *  Resolved [keithschm](https://wordpress.org/support/users/keithschm/)
 * (@keithschm)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-referenceerror-html_forms-is-not-defined/)
 * I added to my Form Code:
 *     ```wp-block-code
       <script>  
       html_forms.on('submit', function(formElement) {
          alert("Hello! I am an alert box!!");
         console.log("hello");
       });
       </script>
       ```
   
 * but I get (index):135 Uncaught ReferenceError: html_forms is not defined
    -  This topic was modified 3 years, 1 month ago by [keithschm](https://wordpress.org/support/users/keithschm/).

Viewing 1 replies (of 1 total)

 *  [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-referenceerror-html_forms-is-not-defined/#post-16664876)
 * Can you try either adding “on dom ready” or adding this code to the end of the
   page instead of in the header. I think it may be executing before HTML forms 
   is loaded.
 * Hope that helps. If you have any questions, please let me know!

Viewing 1 replies (of 1 total)

The topic ‘Uncaught ReferenceError: html_forms is not defined’ is closed to new 
replies.

 * ![](https://ps.w.org/html-forms/assets/icon-256x256.png?rev=1754345)
 * [HTML Forms - Simple WordPress Forms Plugin](https://wordpress.org/plugins/html-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/html-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-forms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/uncaught-referenceerror-html_forms-is-not-defined/#post-16664876)
 * Status: resolved