XForms/Delete Confirm

Motivation
Since users frequently spend a lot of time entering data, you want to make sure that if you allow them to delete that they didn't accidentally click on the delete or that they have selected the correct element when they do actually delete a part of the form.

This example uses the XForms  and   statements to conditionally display a delete confirmation dialog. This many not be the most elegant way of doing this. Ideally a future version of XForms will add a confirm="yes" option to the delete trigger. But till then you can use the following example.

Discussion
We use the XForms switch and case statements to reveal the confirmation dialog. The dialog also indicates what record is going to be deleted.

This example does not use CSS to have the dialog appear to display in a separate window above the form. This can be done by wrapping the dialog in divs and styling the divs with CSS.

In the future our hope is that a the delete tag will have a confirmation option such as

Where the message displayed would be a confirmation message.