380
Views
3
Comments
Preventing double clicking button
Application Type
Traditional Web

Hi all,

I did some research regarding preventing double clicking a button in Outsystems.  This to avoid creating more than one records.

I mostly found solutions from a way back.

Does somebody know what is the best solution or best practice to solve this issue.

I found solutions like:

Solution 1

Exended Properties Button

onclick = "var e=this;setTimeout(function(){e.disabled=true;},0);return true;"


Solution 2

To disable the link, I gave a generic Class named (for instance) "PointerClass" to the link I was going to "disable/enable". Then, on the "onclick" extended property of the Link, I set: 


"$('.PointerClass').css('pointer-events','none');"


To enable the Link again, I put a Javascript action at the end of the action called, with the code :

"$('.PointerClass').css('pointer-events','auto');"


Solution 3

Using this tiny JS

https://jsfiddle.net/joaomelont/0kLzhy1s/5/ 


The 1st solution was the easiest one for me. But it this also "best practice?

Or is there a better solution now? :)

2023-04-16 15-25-31
Krishnanand Pathak

Hi @Joao Vizela ,

I think the best way would be to use Button Loading widget. As it prevents the user to create multiple records by mistake(clicking multiple times) until loading is done.



Regards
Krishnanand Pathak

2024-09-12 02-43-38
Deepsagar Dubey

Hi @Joao Vizela 

Create a local variable of Boolean type i.e. EnableButton and set default value as True, and after click on button set EnableButton value to false and refresh the widget,



I hope it'll help you.

Thanks

Deep

2026-03-04 12-08-39
Luiz Henrique Stanqueviski

Hello Guys,

This in my opinion is the most effective way in user interface.

Another alternative would be to ensure that identical records were not considered by the database, using Uniques in the target entity.

See this link:
https://www.outsystems.com/forums/discussion/69401/how-to-ensure-unique-values/


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.