News Flash: IE getElementById Invaded By Form Field Names!

If document.getElementById() isn’t returning the results in IE that you expect, checkand see if you have any form fields with that name. It seems like IE returns them from getElementById() – even if you manually give them an ID different from the name, that doesn’t conflict! Your only hope seems to be renaming the element you need to select, so that it doesn’t have the same name as any of your form fields.

About these ads

One Response to News Flash: IE getElementById Invaded By Form Field Names!

  1. Maven says:

    This is a known bug in IE6, IE7, and IE8 (when not in Standards mode)

    http://webbugtrack.blogspot.com/2007/08/bug-152-getelementbyid-returns.html

    IE pulls their matches from the static document.all collection which causes serious conflict issues. There is a workaround built into the jQuery library or you can use the one posted on the bug tracking site above.

    thanks, maven

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 525 other followers

%d bloggers like this: