+ Start a Discussion
cnewmancnewman 

OnClick JavaScript - Confirmation Option

Hi Everyone,

Is there anyway I can have a confirmation box ask which action, from two options, I want to perform or cancel the operation?

I need a button on the Opportunity, that once pressed asks if you want to postone, close or cancel the action. First two options will change the status accordingly and the last will close the box and action nothing.

I'm familiar with the normal Yes/No confirmation box, not sure if this is possible?

Thanks
Chris
Best Answer chosen by cnewman
srlawr uksrlawr uk
If you check out this accepted answer on StackOverflow you'll see that in order to have a three button javascript alert box, you need to expand outside of native javascript support. JQuery libraries are easy to inlude in visualforce pages, and hopefully with a bit of tweeking the JS block provided in this answer will ive you what you want..

http://stackoverflow.com/questions/9091001/how-to-show-confirmation-alert-with-three-buttons-yes-no-and-cancel-as-it

I imagine (of course!) instead of just popping up an alert as to which button you pressed you are going to shoot off and do some apex remoting to call a controller method?

All Answers

MagulanDuraipandianMagulanDuraipandian
http://www.infallibletechie.com/2012/10/calling-apex-method-from-custom-buttom.html

If this solves your problem, kindly mark it as the best answer.
Hit Like, if it saved your work :-)

Regards,
Magulan
http://www.infallibletechie.com
cnewmancnewman
Thanks Magulan,

I already know how to use the standard confirmation box, I need an amended version with three options. Postpone/Close/Cancel.
srlawr uksrlawr uk
If you check out this accepted answer on StackOverflow you'll see that in order to have a three button javascript alert box, you need to expand outside of native javascript support. JQuery libraries are easy to inlude in visualforce pages, and hopefully with a bit of tweeking the JS block provided in this answer will ive you what you want..

http://stackoverflow.com/questions/9091001/how-to-show-confirmation-alert-with-three-buttons-yes-no-and-cancel-as-it

I imagine (of course!) instead of just popping up an alert as to which button you pressed you are going to shoot off and do some apex remoting to call a controller method?
This was selected as the best answer
cnewmancnewman
Thanks Simlaw, I think that gave me everything I need to know. We don't use Visualforce pages, this is a button on a standard page. My Apex/VF knowlege is very limited.

I'm comfortable with Javascript but any more than that and I'll struggle... I will rethink the process.