Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Handling Message Box parameters

Avatar

Former Community Member
I want to use the following code to force a choice. This code is a simple message box with a yes or no button. How do I know which button was pushed and how can I capture that to use in a simple "if" statement. If the user selects "yes", I want the code to do one thing, if "no" is selected, the code does something else.



Thanks,



Stan



xfa.host.messageBox("Do you want to issue Report?","Prompt",2,2);
1 Reply

Avatar

Former Community Member
Hi Stan,



try this script in the exit event:



var action = app.alert(("Do you want to issue Report?","Prompt",2,2);



if(action == 4)//if yes is selected

{ //your action }

else

// do other action



Regards,



Chris Fourie

www.intelliform.co.za