[jifty-devel] Cancel in onclick not working in IE

Henry Baragar Henry.Baragar at instantiated.ca
Thu Aug 16 13:35:27 EDT 2007


Andrew,

Thanks for looking into this for me.

On Thursday, August 16 2007 12:24 pm, Andrew Sterling Hanenkamp wrote:
> Henry,
>
> Could you post the generated HTML source containing the submit button? That
> might help.
>
> I just checked on Internet Explorer 7 and reconfirmed that confirmation is
> working correctly for me. Are you using IE6 or IE7? I don't have IE6 on my
> laptop, but I can have another guy test IE6 if that's where you're having
> the problem. However, it really should work. The JS code generated by Jifty
> is like this:
>
The miniumum version for IE is 7.  I am seeing the failures using IE 
7.0.5730.11 on Windows XP Professional 2002 SP 2 running in VMWare on Linux.

> if(!confirm('Are you sure you wish to cancel any changes?')) {
> Event.stop(event);
> return false; }
>

From IE7:

<a href="/delete/customer_user/3" onclick="if(!confirm('Delete del me?')) 
return false;">Delete</a>

Has the code been changed since 0.704220?

Henry

> The "return false" is the best (pretty much universally) supported solution
> for stopping the default submit behavior. However, Jifty goes ahead and
> uses Event.stop(event) just to be extra thorough. However, if it's not
> working for you, the HTML should show the problem.
>
> Cheers,
> Andrew
>
> On 8/16/07, Henry Baragar <Henry.Baragar at instantiated.ca> wrote:
> > Hello all,
> >
> > Has anyone else observed a problem with IE where the Cancel button on a
> > confirmation box acts as a "OK" button and causes the action to be
> > executed?
> >
> > I have in my code:
> >
> > Jifty->web->link(
> >           label => "Delete",
> >           url   => "/delete/customer_user/$seq",
> >           onclick       => {confirm => "Delete $name?"},
> >         )
> >
> > This code works as expected in Firefox and Opera.  But in IE, the action
> > is
> > executed (ie. the user is deleted) regards of what the user does.
> >
> > Does anybody know why this is happening in IE?  Does anyone know of a fix
> > or a
> > work around?
> >
> > Regards,
> > Henry
> > _______________________________________________
> > jifty-devel mailing list
> > jifty-devel at lists.jifty.org
> > http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


More information about the jifty-devel mailing list