Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

IE7 does not respect "return false;" in onclick

#2202

Source:
http://github.com/rails/rails/bl...


when confirm && popup
  "if (#{confirm_javascript_function(confirm)}) { #{popup_javascript_function(popup)} };return false;"
when confirm && method
  "if (#{confirm_javascript_function(confirm)}) { #{method_javascript_function(method)} };return false;"
when confirm
  "return #{confirm_javascript_function(confirm)};"
when method
  "#{method_javascript_function(method, url, href)}return false;"
when popup
  "#{popup_javascript_function(popup)}return false;"

IE7 requires the following.
http://dev.rubyonrails.org/brows...


event.returnValue = false;

References:
http://www.ontola.com/javascript...
http://dev.rubyonrails.org/brows...

Reported by Rusty Burchfield · March 10th, 2009 @ 07:39 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Rusty Burchfield
  2. Zach Brock
    Zach Brock
    • Tag changed from :confirm, :method, :popup, ie7, link_to to :confirm, :method, :popup, ie7, link_to, patch

    This looks like a good fix to an IE7 specific bug. +1

    April 28th, 2009 @ 05:02 AM

  3. Matt Jones
    Matt Jones

    Just tried this against IE7 and couldn't reproduce. This appears to be a problem with certain BHOs that muck around with event handling, notably FlashGet and some phishing filters. (see this discussion for more info)

    Also note that, in general, the code being generated in that part of url_helper is going straight into an onclick handler, where event isn't even defined in all browsers. (Firefox, for instance)

    May 10th, 2009 @ 10:50 PM

  4. Pratik
    Pratik
    • State changed from new to invalid

    Please reopen if this is still an issue.

    August 9th, 2009 @ 01:57 AM

  5. Sam Saffron
    Sam Saffron

    Cowboys, I just lost 2 hours of my time to this stupid bug, I can confirm this happens in ie8. I can also confirm this patch fixes it.

    Please accept this patch.

    January 25th, 2010 @ 04:26 AM

  6. Sam Saffron
    Sam Saffron

    This happens due to a bug in jquery 1.4 release !! assuming it was around in other forms due to similar javascript hackery.

    http://dev.jquery.com/ticket/5835

    January 25th, 2010 @ 05:08 AM

  7. Sam Saffron