views:

55

answers:

1

I'm having a puzzling issue with Javascript/jQuery and a handful of IE 7 users. I'm lost since I can't reproduce the issue with any IE 7 installation. Here's the code:

   $("form").submit(function() {
            $(this).attr("action",$(this).attr("action").replace(/^\/foo/,""));
            $("input[type=submit]", this).attr("value","Please wait...");
            $("input[type=submit]", this).attr("disabled","true");
            return true;
    });

This removes for /foo from the form action and submit's the form without issue in all modern browsers. But for some reason with SOME IE 7 users it doesn't update the action and submits it to the original.

I thought it was an issue with loading jQuery from Google, but I've moved it locally and other jQuery code executes from this same file without an issue.

A: 

Try making the regex case insensitive. (/^\/foo/i)

SLaks