I'm trying to pass an extra parameter to an event listener that I have added dynamically, and I have implemented this solution with a slight variation before.
The error I am getting is "A term is undefined or has no properties".
So it may seem confusing, but here's what I'm doing: I'm creating a set of buttons, among other things, from an array.
When rendered, the button ids will read as:
btnWarrantyPContact
btnServicePContact
btnShippingPContact
btnPartsPContact
...
In the code you will see the first assignment to a label "lbl", and THIS WORKS. Within the IF block is the code that no longer works (I'm thinking it has something to do with being in the function within the function...?). The commented line below that shows a hard-coded ID field, which also works when used.
So, the "offending" code works above, and it's hard-coded value works as a replacement...