Skip to main content
Level 2
Aug 10, 2021 7:07 PM UTC
Solved

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

We are testing out this form:

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

SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Aug 10, 2021 7:49 PM UTC

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().

 

1 reply

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Aug 10, 2021 7:49 PM UTC

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().

 

Translate