Sitecore 9.2 Error on Form Submit: Uncaught TypeError: Cannot read property ‘unobtrusive’ of undefined

If you are reading this , it means you are victim of this JS error which you see in your browser console on form submit. I stuck with this and burned a whole day in investigating the root cause of this error. I went through many posts but nothing worked out in my scenario.

I went through few posts which are given below and I think you should take a look at them before you continue here ( if you are not already gone through)

http://madhuanbalagan.com/sitecore-9-forms-uncaught-typeerror-cannot-read-property-unobtrusive-of-undefined

https://stackoverflow.com/questions/7911439/uncaught-typeerror-cannot-set-property-unobtrusive-of-undefined

https://github.com/jquery-validation/jquery-validation/issues/1829

if you are still here… means your issue is not resolved yet. Now, let’s explore what I did to fix this issue.

I opened OuterLayout.cshtml file and noticed that the Jquery was referenced after the @Html.RenderFormScripts() method call.

OuterLayout1

This was not loading the jquery.validate and other required files.

I just referenced some of the required JS files before the @Html.RenderFormScripts() method call. outerlayout2

This resolved the error and form submitted successfully. I am hoping that this can help some in their Sitcore journey.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s