Announcement

Collapse
No announcement yet.

IE8/jQuery Not Playing Ball

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • IE8/jQuery Not Playing Ball

    Code:
    $("#submitButton").click(function(){
      $.post("/dosomething.php",
             {action:"go",email:$("#email").val()},
             function(html){ alert(html); },
             "html");
      return false;
    })
    The 'dosomething.php' script returns '1' on success, or an error message on failure (for example, 'Invalid email address'.) However when the script is going to return '1' (ie. it succeeds) IE8 ignores the 'return false;' line and sends the visitor to the script directly... any ideas why this would be? Doesn't happen in anything else I've tested

  • #2
    The only help I can offer is that you should be using the .submit() function on the form element, not a click function on the submit button.

    http://docs.jquery.com/Events/submit

    Other than that, I'm not really sure what you're doing. Why validate the form with PHP?

    There are loads of jQuery validation plugins (scripts) out there.
    Last edited by vanishdesign; 09-15-2009, 09:58 AM.
    Swedish Meatball Pornography

    Comment


    • #3
      Dah, sometimes I really should RTFM. That fixed the issue, all works perfectly now, thanks a lot

      (And I'm using PHP for compatibility; I'll add some pretty client-side validation later...)

      Comment

      Search

      Collapse

      Sponsor

      Collapse

      Incredible Stock

      Latest Topics

      Collapse

      • KitchWitch
        Reply to Hi guys im new
        KitchWitch
        Hi Penguinruwan and welcome to GDF.

        We ask all new members to read very important links here and here. These explain the rules, how the forum runs and a few inside jokes. No, you haven't...
        Today, 01:24 PM
      • PrintDriver
        Reply to Hi guys im new
        PrintDriver
        Not quite sure what to tell you.
        The profession of graphic design is not learned by watching tricks on Youtube or learning the software buttons. There is quite a bit of theory that goes into a good...
        Today, 01:22 PM
      • PrintDriver
        Comment on Google Fiber
        PrintDriver
        Boston is only a Webpass city anyway, and only for condos and apartment buildings.
        Looks like they still plan to expand into a (very) few new cities:
        https://fiber.google.com/newcities/
        Today, 01:13 PM
      • cwelsch
        UI Designer Full-time in Games/Education (Irvine, CA)
        cwelsch
        Your designs can make a difference.
        MIND Research Institute is utilizing gamification and neuroscientific research to push the boundaries of education, and we need a pixel-perfect UI designer...
        Today, 01:06 PM
      • B
        Comment on Dream jobs?
        B
        Yeah, I'm not sure how this one got through. I've changed the URL to something else.
        Today, 12:45 PM
      GDF A division of Mediabistro Holdings Adweek | Mediabistro | Clio | Film Expo Group Contact Us | Terms of Use | Privacy Policy Copyright 2016 Mediabistro Holdings
      Working...
      X