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

Andrew Sterling Hanenkamp sterling at hanenkamp.com
Thu Aug 16 12:24:50 EDT 2007


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:

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

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.


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070816/fc866c96/attachment.htm

More information about the jifty-devel mailing list