How to prevent button from being clicked "by mistake"?

Hi there,
I got the following situation: There is a button to check in once someone arrived. When a person clicks the button the first time, the button changes the color to indicate that it got clicked. After some time that noone clicked the button, the screensaver turns on. If a person wants to stop the screensaver and presses enter, the button gets triggered as well, which should not happen (same happens if you stop the screensaver with a mouse click, in case the cursor was still on the button before the screensaver started). What is the best way to solve this?

Hi Julian, didn’t understand your question completely, if there was a screenshot it would be easy to understand.

You can change bool variable from false to true, when button is first time clicked and then apply condition on disabling the button when that variable is true, so that it wouldn’t be clickable.
I hope this would solve your problem.

Hey Fahad_Jalil, thanks for your reply.
I try to explain again, hope it’s better to understand now (screenshot doesnt help here):

Imagine a website where there is only one button. The user clicks the button (and does not move the mouse afterwards). After some time, the screensaver of the computer turns on. The user wants to stop the screensaver and presses the enter key (or does a click with the mouse).
However, this does not only end the screensaver, but also triggers another button click on the website - which should not happen!

Is this better to understand? I wonder how I can prevent this to happen? Deactivating the button is not really an option, since the user shall be able to click the button if he actually wants to click it. My idea was to set the focus on a text element (which I placed somewhere else on the page) once the user clicks the button. This didn’t work at all (also, it wouldn’t cover the case that the user performs a mouse click).

Any thoughts & ideas higly appreciated!

Part of my problem is resolved: I’ve set a page workflow onKeyDown that simply has a pass-through condition (which results to false) and I also added a blur method for the button after it got clicked. By this, the button is not triggered in case the user presses the enter key.

However, this still does not cover the case that the user performs a click to end the screensaver (and in the same time clicks the button).

Anyone an idea?

Does the button click happen once per session or only first time they ever arrive to the site and needs to never click it again?

There’s a couple ways to solve this depending on the requirements but lets say it’s once per session.

Create a variable called clicked and default it to false, bind it to the buttons disabled setting and create a workflow that turns it to true when they’ve clicked it.

If you need this to persist longer you can choose to save to local storage but that won’t last forever, if you need them to only click once you may need a db.