cancel
Showing results for 
Search instead for 
Did you mean: 

How to include checkbox in displayPrompt confirmation box?

vzanzrukia
Champ in-the-making
Champ in-the-making

I am using the below code snap to display confirmation box.

Alfresco.util.PopupManager.displayPrompt( { noEscape: true, title: this._msg("message.confirm.delete.title"), text: this._msg("message.confirm.delete", $html(this.event.title), displayDate), buttons: [ { text: this._msg("button.delete"), handler: function ... }, { text: this._msg("button.cancel"), handler: function ... isDefault: true }] });

Is there any way to integrate the checkbox within this like given below screenshot?

Any help/suggestion/direction will be highly appreciated. Thanks in advance. Example with expected checkbox confirmation box

1 REPLY 1

sanjaybandhaniya
Elite Collaborator
Elite Collaborator

Hi,You can include checkbox in displayprompt with below code.

Alfresco.util.PopupManager.displayPrompt({
title: "Delete",
text: "<input type=checkbox id=dltDoc> Want to delete?",
noEscape: true,
buttons: [{
text: "OK",
handler: function onSubmit() {
var chkBox = YAHOO.util.Dom.get("dltDoc").checked;
if(chkBox){
   //Your custom code
}else{
      //Your custom code
}

this.destroy();
}
},

{
text: "Cancel",
handler: function onSubmit() {
this.destroy();
},
isDefault: true
},

]
});

Thanks,

Sanjay Bandhniya

Contcentric