Is there a way to stop the user click on a menu item on the clientside? I tried with CancelPostBack and it seems not working.
My BLOCKED SCRIPT
function MasterMenu_ItemClick(menuId, itemId){
var MyCtl = recupereId("ctl00_ContentPlaceHolder1_btnApply"); try { if (!MyCtl.disabled){ var Messg = 'Update not done. Do you want to continue ?'; if (!confirm(Messg)){ igmenu_getMenuById(menuId).CancelPostBack = true; } } }catch (e) { //The btnApply not exist into this formalert("e.description is: " + e.description); }
var MyCtl = recupereId("ctl00_ContentPlaceHolder1_btnApply");
try {
if (!MyCtl.disabled){ var Messg = 'Update not done. Do you want to continue ?'; if (!confirm(Messg)){ igmenu_getMenuById(menuId).CancelPostBack = true; } }
var Messg = 'Update not done. Do you want to continue ?'; if (!confirm(Messg)){ igmenu_getMenuById(menuId).CancelPostBack = true; }
var Messg = 'Update not done. Do you want to continue ?';
if (!confirm(Messg)){
igmenu_getMenuById(menuId).CancelPostBack = true;
}
//The btnApply not exist into this formalert("e.description is: " + e.description);
//The btnApply not exist into this form
if(itemId == igmenu_getMenuById(menuId).getItems()[3].Id) //selected the delete option
return confirm('Are you sure you wish to delete this failure mode? After deletion, the information is unable to be recovered.');
Even after clicking cancel the postback continues and performs the deletion, though. Is there any way to make the confirmations work with the UltraWebMenu?
Hello MercerEng,
The client-side event model of UltraWebMenu is a bit different from what we are used to in default HTML controls. So, per the docs of UltraWebMenu, you can cancel the postback event by setting the CancelPostBack property of the menu instance to true. "return" statement will have no effect in this case, I am afraid.
Please, take a look at my code sample I sent for Pierre above - hopefully this will works fine for you as well.