Welcome Guest Search | Active Topics | Sign In | Register

MsgBox event handling in javascript Options
Vishakha
Posted: Monday, February 8, 2010 7:29:27 AM
Rank: Member
Groups: Member

Joined: 2/5/2010
Posts: 24
I am using new msgbox control
I want the functionality somthing like this (same as traditional confirm("") function in Javascript)

function DeleteAll()
{
if(confirm("Do u want to delete all records?") == true)
{
//Do Something;
return true;
}
else
{
//Do Something;
return false;
}
}

Now instead of confirm function() I want to use msg box control.As per the documentation I need to write separate funtion to handle user action(ok/cancel) as following

function DeleteAll()
{
eo_MsgBox(
"MsgBox1","Hello","This is a test message.",null,
[
{
Text: "OK", //OK button
//ClientSideHandler: "on_button_clicked" //Client side event handler
},

{
Text: "Cancel", //Cancel button
//ClientSideHandler: "on_button_clicked" //Client side event handler
}
]);
}

function on_button_clicked(msgBox, buttonIndex)
{
if(buttonIndex == 0)
{
//Do Something;
return true;

}
else
{
//Do Something;
return false;
}
}

Instead of this I want to use single function(just like javascript confirm()). Can we achive the same using existing functionality of msgbox? If not can you provide the return value facility for the msgbox?
eo_support
Posted: Monday, February 8, 2010 9:33:17 AM
Rank: Administration
Groups: Administration

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

No. You can not use a single function to do it. The MsgBox function always returns immediately. So you must use separate handler functions to handle the button event.

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.