volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

Forms generated script indexof undefined

Hi,

I'm having an issue with clicking buttons in episerver forms - buttons in this case are the submit, next step etc. form elements.

I've set up "@Html.RequiredClientResources("Header")" just before the closing head tag, and "@Html.RequiredClientResources("Footer")" just before the closing body tag.

The issue is only present when the "@Html.RequiredClientResources("Footer")" is in the HTML document, if I remove it - everything works. However we have other solutions that require the "@Html.RequiredClientResources("Footer")" to be present. I've tried to use both the built in jQuery, and an external source without any luck - the stacktrace below is from using the external source.

The console error is the following:

Uncaught TypeError: Cannot read property 'indexOf' of undefined
at WebResource.axd?d=Tz…37213340560000000:1
at HTMLDivElement.<anonymous> (WebResource.axd?d=Tz…37213340560000000:1)
at Function.each (jquery-3.3.1.js:354)
at jQuery.fn.init.each (jquery-3.3.1.js:189)
at h (WebResource.axd?d=Tz…37213340560000000:1)
at HTMLButtonElement.t (WebResource.axd?d=Tz…37213340560000000:1)
at HTMLButtonElement.dispatch (jquery-3.3.1.js:5183)
at HTMLButtonElement.elemData.handle (jquery-3.3.1.js:4991)

When you further inspect the error, it seems that 'n.DependencyInactiveElements' is undefined:

 return a.getAllDataElements(t).each(function(t, a) {
                            r = function(t, n) {
                                var r = e(t)
                                  , a = F(r)
                                  , s = i.getElementName(r)
                                  , l = r.attr("id") || s
                                  , d = o.getElementValidators(n.ValidationInfo, l)
                                  , m = !0;
                                r.removeClass("ValidationFail ValidationSuccess"),
                                a.hide();
                                var p = i.getElementValue(r);
                                if (n.DependencyInactiveElements -- ERROR IS HERE --.indexOf(s) < 0 && d instanceof Array && d.length > 0) {
                                    var f = o.validateFormValue(s, p, d)
                                      , u = e.grep(f, function(e) {
                                        return 0 == e.isValid
                                    })

Does anyone have any idea clue what the issue might be?

Best regards.

#221705
Apr 23, 2020 16:36
Vote:

In order to fix this we uninstalled the episerver forms nuget package, removed all the related files inside the modules folder, and installed the relevant episerver forms nuget packages.

#221887
Apr 27, 2020 16:37
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.