SOLVED

Form won't submit: Uncaught TypeError: Cannot read property 'fadeOut' of undefined

Go to solution
jendaytwo
Level 2

Form won't submit: Uncaught TypeError: Cannot read property 'fadeOut' of undefined

We are testing out this form:

https://daytwostaging.wpengine.com/resources/resource-asset-title/

 

There is nothing different about it from our other forms except it is not a modal so it should be simpler right? Sadly this is the error I am seeing:

 

Uncaught TypeError: Cannot read property 'fadeOut' of undefined
at Object.c.hide (forms2.min.js?ver=5.7.2:7)
at forms2.min.js?ver=5.7.2:4
at Function.<anonymous> (forms2.min.js?ver=5.7.2:4)
at Function.each (forms2.min.js?ver=5.7.2:5)
at O (forms2.min.js?ver=5.7.2:4)
at Object.B [as success] (forms2.min.js?ver=5.7.2:4)
at f (forms2.min.js?ver=5.7.2:4)
at e (forms2.min.js?ver=5.7.2:4)
at dispatch (forms2.min.js?ver=5.7.2:6)
at q.handle (forms2.min.js?ver=5.7.2:6)

Hoping someone here can help

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form won't submit: Uncaught TypeError: Cannot read property 'fadeOut' of undefined


There is nothing different about it from our other forms except it is not a modal so it should be simpler right?

It’s only simpler if your other custom JS code is aware that there isn’t a modal/;ightbox.

 

You have code in this file —

 

 

https://daytwostaging.wpengine.com/wp-content/themes/daytwo/assets/js/theme.js?ver=5.7.2

 

 

— that still tries to load the form in lightbox mode, because it sees an element with the lightbox class (open-lightbox) in the document. The onSuccess method is thus confused and errors out because there isn’t a lightbox to hide().

 

View solution in original post

1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

Re: Form won't submit: Uncaught TypeError: Cannot read property 'fadeOut' of undefined


There is nothing different about it from our other forms except it is not a modal so it should be simpler right?

It’s only simpler if your other custom JS code is aware that there isn’t a modal/;ightbox.

 

You have code in this file —

 

 

https://daytwostaging.wpengine.com/wp-content/themes/daytwo/assets/js/theme.js?ver=5.7.2

 

 

— that still tries to load the form in lightbox mode, because it sees an element with the lightbox class (open-lightbox) in the document. The onSuccess method is thus confused and errors out because there isn’t a lightbox to hide().