Monday, March 16, 2009

Yes/No buttons in the place of Ok/ Cancel buttons using Javascript and Vb script

Place this VB Script in ur aspx page
Function makeMsgBox(tit,mess,icon,buts,defs,mode)
butVal = icon + buts + defs + mode
makeMsgBox = MsgBox(mess,butVal,tit)
End Function

then copy this to your Js File


function Confirm(msg)
{
ie4 = document.all;
ie5 = document.all;
if(ie4 ie5)
{
// if its IE4+ call the VB Script
retVal =
makeMsgBox("Patient Attachment",msg,1,1,1,1);
// which button was pressed?
if(retVal == 6)
{
return true;
}
else
{
return
false;
}
}
else
{
return Confirm(msg);
}
}

Call the js function Confirm()

Confirm('Do you want to delete details now ?')


No comments:

Post a Comment