View Full Version : [Solved] Ext.Msg.Show Problem

14 Aug 2009, 6:23 PM
Here's my case.I have a link which calls a javascript function (userConfirm) which in turn shows a confirmation dialog asking the user to confirm that he wants to cancel the transaction. Problem is that it redirects without waiting for the user input.

function userConfirm(){
title: 'Are you sure?',
msg: 'Are you sure you want to skip adding a representative?',
icon: Ext.MessageBox.QUESTION,
buttons: Ext.Msg.OKCANCEL,
fn:function(btn, text){
if(btn == 'cancel'){
return false;
window.location = "<?php print url::site(); ?>testController/test";
}Any ideas? thanks :)

15 Aug 2009, 5:31 AM
That works for me in firefox.

15 Aug 2009, 7:06 AM
You have to stop the event. Ext.MsgBox.show just returns, and the navigation proceeds.

15 Aug 2009, 9:13 AM
Ah! Yeah, the link should not have an HREF in this case. Good catch nige.

16 Aug 2009, 5:35 PM
solved mine by changing the link to a html tag input with type set to button...
note: html tag button didnt work for me that's why i used the input tag instead

thanks guys.. :D