Expand my Community achievements bar.

SOLVED

disable click

Avatar

Level 4

I have a button that should only be clicked once. Once it is clicked, it needs to be disabled (i.e. click event should not be fireable). I have JavaScript that I thought accomplished this:

this.access = "readOnly";

But it appears this only disables the ability to "click" using the mouse. The button is still focusable and enter causes the click event to fire.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi,

Instead of readOnly use protected. This will disable all functions of the button and also exclude it from being focussed on when using the TAB key.

this.access = "protected";

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

Hi,

Instead of readOnly use protected. This will disable all functions of the button and also exclude it from being focussed on when using the TAB key.

this.access = "protected";