You need to sign in to do that
Don't have an account?
sfdcfox
Confirmation dialog cancels action; used to not do this.
<apex:commandButton onclick="return confirm('Are you sure?')" action="{!myaction}" value="Do This!" />
Previously, it would ask if you wanted to confirm your action, and then do it. As of a day or two ago, using this exact method causes it to not perform the action. Removing the onclick causes it to work correctly again. Anyone else having this problem?
I remember I had this problem a while back. I just assumed it didn't work the way you did it. Since it worked for you before, maybe this error is caused by some other code? Did you add anything a day or two ago. I would be curious to find out why that doesn't work.
My work around was to rephrase the statement. Try this.
Let me know if that made a difference. If it does, again, I am curious why one works and the other doesn't.
All Answers
I remember I had this problem a while back. I just assumed it didn't work the way you did it. Since it worked for you before, maybe this error is caused by some other code? Did you add anything a day or two ago. I would be curious to find out why that doesn't work.
My work around was to rephrase the statement. Try this.
Let me know if that made a difference. If it does, again, I am curious why one works and the other doesn't.
hi sfdcfox,
Could you try
function confirmation(){ return confirm('Are you sure?'); }
onclick="return confirmation();"