Avatar

Level 9

Hi Peta,

The message box returns some integer value depending the button you have clicked. Search messageBox in the help. By getting the value of the returned value you can manipulate your script.Try the following.

var response = xfa.host.messageBox("This will clear all data from the fields and reset defaults.  Are you sure?", "Clear all form fields",2,2);

app.alert(response);// This line is only for your information to check what's returning.

if (response == 4) // As in your case Yes returns '4' No returns '3'

     {

        xfa.host.resetData();
        xfa.form.remerge();

     }

else

     {

          Some code you want to execute.

     }

Thanks,

Bibhu.