+ Start a Discussion

Not able to restrict user from clicking Command Button multiple times



i have created a visual force page. I am saving record on the button click.

but i am not able to restrict the user from clicking command button multiple times.


I have tried with providing action support on onclick and oncomplete event of the command button to change its disabled property.

Still the use is able click command button multiple times.

It creates unwanted records.


If any one has the solution, please share it with me.


You can use java script to hide the button after clicking first time by the user. Find below a sample code :

<apex:page Controller="your_controller">
function check()

<apex:commandButton value="change" action="{!anyActionMethod}" id="bt" reRender="id of any region"/>