Disable IE10 clear field in Compatibility mode
Asked Answered
C

2

3

I don't want the clear functionality (the X button) in text boxes rendered in IE10 and above. For this, I'm setting the display of the pseudo element -ms-clear to none. However, it still shows up when IE is running in Compatibility mode. Since this is an Intranet site, it will always run in Compatibility mode. And there's no workaround for this: http://connect.microsoft.com/IE/feedback/details/783743/disable-ie10-clear-field-button-when-rendering-in-compatibility-mode

Using <add name="X-UA-Compatible" value="IE=edge" /> in web.config to force IE to run in standard mode is not recommended as per msdn, as far as production scenarios are concerned. Is there any other way of getting round this?

Chipper answered 18/11, 2013 at 14:38 Comment(3)
I used <meta http-equiv="X-UA-Compatible" content="IE=edge"> and it worked well. That is definitely a better solution than working in compatibility mode.Navigation
As per the link you included in the question, this is simply not possible. IE10/11 does not include this ability in compat mode. If you want to get rid of the clear widget, the only option you have is to switch to standards mode. There really is no other way around it. (I'm curious to know why your site is stuck in compat mode; the chances are it doesn't really need to be).Regenerative
@Spudley: IE is configured by default to show Intranet sites in Compat mode, and I don't want to leave it to the users to switch to Standard mode. Using IE=edge doesn't seem to be a recommended way in production. :(Chipper
H
1

According to microsfts' official response "The issue you are reporting is by design".Here is a link to official response from microsoft link

Honeybunch answered 20/6, 2014 at 18:45 Comment(0)
F
0

While it is definitely not recommended in all cases to set X-UA-Compatible header to IE=edge, since it leaves control out of your hands which 'edge' version is being selected, this entirely depends on you trusting your code enough to be sufficiently HTML5-compliant to keep rendering correctly in future browsers. If you do, you can ignore the recommendation not to use IE=edge, that's why it's a recommendation and not forbidden.

More conservatively you could also opt to select a fixed version. If your audience is using a mixed bag of IE9, 10 and 11 installs, and you're sure it works fine in IE9 - use this:

<add name="X-UA-Compatible" value="IE=9" />

This will make all more recent IE's than 9 also render it in IE9 standards compliant mode, which is much better than basic compatibility mode (which is essentially IE7 Quirks).

In a nutshell - recommendations are just that, and can safely be ignored if you are aware of the consequences and take proper precautions.

Filament answered 22/11, 2013 at 0:44 Comment(1)
(a late comment but...) FYI I downvoted this response because it didn't answer the question, which is more about fixing ms-clear than how to use X-UA-Compatible (in fact, forcing IE9 mode is what's causing the problem, not the solution as implied by the answer)Supraliminal

© 2022 - 2024 — McMap. All rights reserved.