Prevent User from Keep Clicking on Submit Button while processing

In a Submit Button, how do I prevent user from clicking the submit button twice? I had tried placing the webbutton1.Enabled = False statement in the action event but it does not disabled the button immediately. It only disabled it after the completion of action event. Therefore, user can still keep clicking on the submit button.

Set AutoDisable to true. It’ll be disabled as soon as the user clicks it.

Thank you Greg. That is what I am looking for. :slight_smile:

wow, thats a great thing, how did I miss that was even in there… Going to go revise some code.

Note that the first line of each button’s Action event must be to set me.Enabled = True otherwise it stays disabled!

Aren’t you meaning the last line of Action ? Would seem more logical.

The last line would be most sensible, but I place it as the first line in case in the code I need to do a Return before reaching the bottom of the action code. Both will stop the multi-clicks.

Why not. The UI change will happen at the end of the event anyway.

Or - popup a non-Modal dialog to let the user know that something is being done that you close when the task completes.

Well, a modal dialog would prevent the user to click as well…

But won’t the dialog appear after the button code completes? Wasn’t there a few threads on that subject already?

Well, not if you just display the webdialog in the button and you place the code in the WebDialog open event.