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?

CopyPasteDev
  • 196
  • 1
  • 14
  • 3
    I used `` and it [worked well](http://stackoverflow.com/a/8942455/7586). That is definitely a better solution than working in compatibility mode. – Kobi Nov 18 '13 at 14:42
  • 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). – Spudley Nov 18 '13 at 15:44
  • @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. :( – CopyPasteDev Nov 18 '13 at 16:09

2 Answers2

1

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

roshan
  • 2,104
  • 2
  • 19
  • 32
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.

Niels Keurentjes
  • 38,099
  • 7
  • 85
  • 126
  • (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) – patstuart May 01 '14 at 19:17