Confirmation for Button control submission
I know you can require a confirmation for a regular Submit button, but if I'm using a generic Button control how can I require a confirmation before the user submits? I've tried some JavaScript but I just can't figure it out. Thanks in advance for any assistance.
-
You should be able to use the eForm event onBeforeSubmit and put in a JavaScript confirm dialog something like this:
eFormEvents.onBeforeSubmit = function (callback) {
/* insert any additional logic you need here */
if (confirm("You have chosen to Submit this form.\n\nIf this is correct, click OK.\nIf this is not correct, click Cancel to return to the form.")){
callback (true);
} else {
callback (false);
}
}This will present the user a pop-up dialog box with an OK and Cancel button. If they click the "OK" button (confirming the action) then the callback true is executed allowing the form to submit. If they click "Cancel", then callback false is executed and the form does not submit.
It may not be the prettiest solution since you can't really modify the appearance of the Confirm dialog (or the buttons it shows) but it should work.
Here is a link to the documentation on eForm events:
https://documentation.agilepoint.com/00/appbuilder/cloudformEvents.html
請登入寫評論。

評論
4 條評論