Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="javascript:if(ConfirmChoice('Delete row?', 'Are you sure you want to delete this row?')) DeleteRow('{!imported.Id}');" style="font-weight:bold">Delete</a>
- function ConfirmChoice(title, message) {
- ConfirmDialog(title, message).then(function(answer) {
- return answer;
- });
- }
- function ConfirmDialog(title, message) {
- var defer = $.Deferred();
- var yesButton = document.getElementById('yes');
- var noButton = document.getElementById('no');
- var confirmationDialog = document.getElementById('confirmationDialog');
- document.getElementById('confirmationTitle').innerHTML = title;
- document.getElementById('confirmationMessage').innerHTML = message;
- confirmationDialog.showModal();
- // Update button opens a modal dialog
- yesButton.addEventListener('click', function() {
- defer.resolve("true");
- confirmationDialog.close();
- });
- // Form cancel button closes the dialog box
- noButton.addEventListener('click', function() {
- defer.resolve("false");
- confirmationDialog.close();
- });
- return defer.promise();
- }
- <a href="javascript:if(window.confirm('Are you sure you want to delete this row?')) DeleteRow('{!imported.Id}');" style="font-weight:bold">Delete</a>
Add Comment
Please, Sign In to add comment