Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

disable click

Avatar

Avatar
Boost 10
Level 3
altrue990
Level 3

Likes

10 likes

Total Posts

73 posts

Correct Reply

14 solutions
Top badges earned
Boost 10
Give Back
Validate 1
Boost 5
Boost 3
View profile

Avatar
Boost 10
Level 3
altrue990
Level 3

Likes

10 likes

Total Posts

73 posts

Correct Reply

14 solutions
Top badges earned
Boost 10
Give Back
Validate 1
Boost 5
Boost 3
View profile
altrue990
Level 3

09-02-2019

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

10-02-2019

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";

Answers (0)