accessing the NextButton from within an event handler | XM Community
Skip to main content

hello, we are trying to use the JS enable/disableNextButton calls from within a JS change handler for some radio buttons. How do we access the NextButton from within an event handler? thanks

Kurt

If you can post the code then it would be good to understand as what you want.
If you want to enable/ disable button then put the below code outside event handler:
var that = this;
and inside event handler use it as shown below:
that.enableNextButton();
that.disableNextButton();


"that" fixed it, thank you! But I had tried that idea before, just not with "that". Is there something magical about that?

thanks again.


when we are assigning "that" (that is just a variable name it can be anything) with 'this', we are actually assign 'that' to the current question object. Hence we can use that variable anywhere. But when we use this.enableNextButton, in event handler, this refers to object element on which event has ocurred.


Leave a Reply