MattsBits
MattsBits

MattsBits

Disable Apex Button On Mouse Click  

by Matt Hawkins, 10/06/2010
Categories : APEX

In APEX it is sometimes nice to disable a button once the user has clicked it. This can help prevent over enthusiastic users clicking the button more than once.

It is quite simple to do and you only have to paste a simple piece of JavaScript into the Button's "Button Display Attributes".

The following image shows the JavaScript within the "Attributes" :

disable_button_onclick.png


The required code is :

onmouseup="this.disabled=true;doSubmit('IMPORT');"


As the user releases their mouse button the button is disabled. The "doSubmit" command is required to complete the submit as disabling the button prevents the standard submit from firing.

In this example the Button request value is "IMPORT and is stated in both the JavaScript above and the Button's "Button Request" attribute.

Author : Matt Hawkins  Last Edit By : Matt Hawkins
PHP Powered  MySQL Powered  Valid XHTML 1.0  Valid CSS  Firefox - Take Back The Web  EUKHost - Recommended Webhosting Solutions

MattHawkins CMS v3.0 - Copyright 2009-2022