document.id("group" + b) is null when click next

softforge

Member
Since upgrading from github yesterday, I now cant complete some of my multi-page forms as I get this error which clicking next:

Error: TypeError: document.id("group" + b) is null
Source File: /media/com_fabrik/js/form-min.js
Line: 1

Interestingly is doesn't cause a problem when clicking next the first time but the second next gives this error and doesn't change the page so the form cant be completed. I do have 1 group set not to show but i'm not sure if this is relevant as it use to work fine.

You can see an example on the diabetes site here:

/tools/goals/getting-active/form/48/0

Many thanks
 
This should be fixed in github. The issue was that you have a group set to 'show group' : 'no'.
However, our multlipage code was not taking that into account, so adding the group into the list of groups to check when moving to a new page, and failing because the group did not exist.

-Rob
 
Great, I wondered if that was the problem but it has been set like that for quite a while and the problem only started happening recently (since the last update I think).

I will update again today and report back.

Many thanks! :)
 
I upgraded today and the problem still occurs but has changed slightly:

Error: TypeError: document.id("group" + gid) is null
Source File: /media/com_fabrik/js/form.js
Line: 502

I had a little hack and have fixed the problem by changing this code:

Code:
        this.options.pages.get(this.currentPage).each(function (gid) {
            if (document.id('group' + gid).getStyle('display') !== 'none') {
                visible = true;
            }
        });
To this:

Code:
        this.options.pages.get(this.currentPage).each(function (gid) {
            if($defined(document.id('group' + gid))) {
                if (document.id('group' + gid).getStyle('display') !== 'none') {
                    visible = true;
                }
            }
        });
I'm sure there is a better way but this works for now. :)
 
I dont think your update was successful, the code should be:

Code:
this.options.pages.get(this.currentPage).each(function (gid) {
            var group = document.id('group' + gid);
            if (typeOf(group) !== 'null') {
                if (group.getStyle('display') !== 'none') {
                    visible = true;
                }
            }
        });
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top