Alert Message with Yes/No

Avatar

Avatar

brendab1959

Avatar

brendab1959

brendab1959

13-10-2016

I need the "No" button to cancel the removal of the subform.

The Yes button works, here is my script:

_Subform1.removeInstance(Subform1.count
- 1);

// Prompt the user 

var nResponse =
xfa.host.messageBox("You are about to remove a program. \n\nDo you
want to continue?", "Removing a
program?", 2, 2) 

 

// Test the response: Yes = 4 

if (nResponse == 4)

}

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

17-10-2016

Hi,

Can you change the approach to only call the removeInstance once the Yes button has been selected.

// Prompt the user 

var nResponse = xfa.host.messageBox("You are about to remove a program. \n\nDo you want to continue?", "Removing a program?", 2, 2) 

 

// Test the response: Yes = 4 

if (nResponse == 4)

     _Subform1.removeInstance(Subform1.count - 1);

}

Regards

Bruce