Hello everyone,
I would like to create a click button that prevents user multiple clicks.
Firstly I add the boolean variable and set it false.
When the user clicks the button, it becomes "true".
when it becomes true, the button disappears.
like the following HTML script.
<button id="btn" style="display:block;" onclick="prevent_multiple_clicks()">Submit</button> <script> function prevent_multiple_clicks() { document.getElementById('btn').style.display = "none"; }</script>
<button id="btn" style="display:block;" onclick="prevent_multiple_clicks()">Submit</button>
or make the button disabled
Thank you very much
Hi there,
You just need to control the IsEnabled variable on your action when you want to block it or not.
I send you the OML in attachment with an example.
Kind Regards,João
Hi Tommy,
Usually, the behavior is when you click the use sees the button in a loading status (instead of invisible) so it cannot be clicked multiple times.
If you are working with Reactive or Mobile applications, you have available the ButtonLoading widget from OutSystemsUI:
Another option is to have a boolean variable and place it in the Enabled property of the button:
Then on the beginning of the action you can set it to False (and AJAX refresh it, if you're working on Traditional Web) and set it to True in the end (and AJAX refresh it, if you're working on Traditional Web).
Hello João ,
Thank you for your reply.
I just create a simple demo, When the user clicks the button, it displays a loading icon in the button.
What should I apply in this blank?
Here is my project...
Thank you very much : )