Additional confirmation (modal) prior to sending edit/change to server

Additional confirmation (modal) prior to sending edit/change to server

CapamaniaCapamania Posts: 229Questions: 79Answers: 5
edited May 2016 in Editor

Is it possible to have an additional confirmation (e.g. additional confirmation modal) step that needs to be 'confirmed/checked' by the user prior to sending edit/change to server?

To describe it a bit more, when editing a line in editor a modal pops up where you can change the column data of this line. Before sending the data to the server and being live, I would like to have sth like "Dear User, do you really want to make the changes?" "Yes, I confirm" ... in an additional step that needs to be confirmed ... and then send the data to the server. And on top, it would be great to have an overview of the data which the user confirms being sent in this additional step.

Is sth like that possible? And how? Many thanks

Answers

  • allanallan Posts: 61,821Questions: 1Answers: 10,127 Site admin

    Hi,

    There are two possible ways of doing this with the API:

    1. Use preSubmit which can be used to cancel the submission. Set a flag when the edit view opens to indicate that the question needs to be asked, then in that event handler ask the question (message() for example), cancel the submission and toggle the flag. Then when the form is submitted again allow it to submit.
    2. Use the buttons() method to ask the question instead of immediately submitting the form (by default the submit() method is called). At that point update the buttons again to now submit the form.

    Allan

This discussion has been closed.