68
Views
2
Comments
[Confirmation Dialog] Client Script 'getAttribute' error
Question
confirmation-dialog
Web icon
Forge asset by Samuel Jesus

Hi I experience an client script error regarding "getAttribute" this only happens when I first use the Confirmation Dialog after initial load of the page. It displays but whatever action I click (Continue or Cancel) this error occurs but when I do the same action it did not happen again



2019-02-03 19-16-33
Julius Delorino Jr.

Rogelio Guanlao wrote:

Hi I experience an client script error regarding "getAttribute" this only happens when I first use the Confirmation Dialog after initial load of the page. It displays but whatever action I click (Continue or Cancel) this error occurs but when I do the same action it did not happen again




Hi Rogelio,

can you check on the console on chrome and see if there is an error on the page you're loading.


Cheers,

Julius


UserImage.jpg
Max Larson

I've encountered this same issue while utilizing this forge component.

The root cause for this console error was that document.getElementById (used in the web block JS code) was unable to find a matching element on the page with the specified ButtonId parameter (bound to this web block's properties list). The ButtonId parameter is used to trigger the dialog display when the specified button is clicked.

If you're dynamically setting the "Visible" property on your button, then you need to ensure that the Confirmation Dialog web block is also wrapped in an If condition to prevent it from initializing when your button is not rendered.

However it would be better practice for the web block code to perform a null check after the button element selector fires rather than assuming it's always rendered and available. Maybe this could be added through a feature request with the author of this forge component.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.