Welcome Guest Search | Active Topics | Sign In | Register

Enter or Escape button click blocking for messagebox Options
Bhavesh
Posted: Thursday, April 1, 2010 8:34:13 AM
Rank: Newbie
Groups: Member

Joined: 3/6/2009
Posts: 7
We have one problem with Messagebox here. When message box comes on screen and user press enter or escape the messagebox get closed without callback function call. I want to block the escape or enter button click or want to handle escape or enter button click for messagebox. Do you have any workaround for this
eo_support
Posted: Thursday, April 1, 2010 9:03:06 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. You will need to handle the dialog's ClientSideOnAccept and ClientSideOnCancel event. Both properties take a JavaScript function name. You can return false from your handler to cancel the event.

Thanks!
Bhavesh
Posted: Friday, April 2, 2010 6:06:59 AM
Rank: Newbie
Groups: Member

Joined: 3/6/2009
Posts: 7
When i get the OK & Cancel message box and if user press enter button the OkCallBackFunction of the message box should get called (i.e. Ok button click). Right now message box is getting closed Please have a look on below code which i am using to show message box. what modification i need to do in this code for handling enter press event

function ShowConfirm(Title, Message, OkCallBackFunction, CancelCallBackFuntion) {
var callbackfunction;
if (CancelCallBackFuntion == undefined)
callbackfunction = "AlertCallBack"
else
callbackfunction = CancelCallBackFuntion;

var msg = replaceAll(Message, '\\n', '<br>');
msg = replaceAll(msg, '\n', '<br>');
eo_MsgBox(
"W_Alert", //ID of the MsgBox control
Title, //Message box title
msg, //Message text
null, //Icon
[
{
Text: "OK", //OK button
ClientSideHandler: OkCallBackFunction //Client side event handler
},
{
Text: "Cancel", //Cancel button
ClientSideHandler: callbackfunction //Client side event handler
}
]);

}
eo_support
Posted: Friday, April 2, 2010 8:59:48 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe our original reply has already answered your question quite clearly.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.