This is a migrated thread and some comments may be shown as answers.

how to get the return true or false from radconfirm

3 Answers 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
puru
Top achievements
Rank 1
puru asked on 15 Sep 2008, 04:38 PM

Hi,

I did the below code to get the return value "true" then submit the page again.
what happens is that before getting the value page submit.
first I want to know how to get the return true or false from radconfirm and then how to do submit then sequentially.

function

confirms(arg)

{

var bSave=radconfirm(arg,confirmCallBackFn,300,200,null,'Want to Save');

if (bSave)

{

alert(

'hello');

document.getElementById(

"hidServer").value=1;

document.getElementById(

"form1").submit();

}

else

{

document.getElementById(

"hidServer").value=0;

}

}



function

confirmCallBackFn(arg)

{

alert(arg);

if

(arg == true)

{

document.getElementById(

"form1").submit();

var

oManager = GetRadWindowManager();

oManager.Close();

}

else

{

alert(

'not Closed');

}

}

thanks,
Puru

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 16 Sep 2008, 11:57 AM
Hello Puru,

I am not sure if I understand you correctly. Could you please provide some more information on the task you want to accomplish?



All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
puru
Top achievements
Rank 1
answered on 16 Sep 2008, 12:41 PM

Hi,

var
bSave=radconfirm(arg,confirmCallBackFn,300,200,null,'Want to Save');

if (bSave==true)

{
}
I just want to get true or false after click on ok, cancel.
 above code is oaky?
Thanks,
Puru

0
Svetlina Anati
Telerik team
answered on 17 Sep 2008, 02:25 PM
Hi puru,

When using radconfirm, you should check the argument in the callback function which you specify as the radconfirma second argument. This being said, your code should look like the following one:

function  confirms()   
{  
   radconfirm(arg,confirmCallBackFn,300,200,null,'Want to Save');   
}  
 
function confirmCallBackFn(arg)  
{  
   if(arg)  
   {  
     alert('The user clicked the OK button');  
   }  
}  
 
 


Greetings,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
puru
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
puru
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or