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?
		 
	 | 
	
		Rank: Administration Groups: Administration
 
 
Joined: 5/27/2007 Posts: 24,427 
	 | 
		   
	     
		    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!
		 
	 |