IE 11 v11 does not respect “disabled” property on inputs on a single machine

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



IE 11 v11 does not respect “disabled” property on inputs on a single machine



I support an asp.net web application using Jquery v3.3.1 which uses JavaScript to disable various inputs of type "text" or "date" using code like the following:


$('#id').prop('disabled',true);



When this bit of javascript is applied to an input of type "text" or "date" its appearance changes to greyed-out and a user cannot edit the contents of the input.



The problem is, when this page is viewed in IE 11 on one machine in our building the "disabled" property of inputs of type "text" or "date" is partially ignored. Hundreds of machines access this web page but only one machine is known to have this issue.



By "partially ignored" I mean that when the input's 'disabled' property is set true as in the code snippet above the input appears disabled, but the user is able to type values into the disabled input (any masks on the input are ignored; for example, date masks, or masks that limit inputs to integers).



On the bright side, these phantom values typed into the disabled input are also ignored; for example, if the input is of type "date" and the user enters the word "cat", no client-side validation error occurs, and when the form is posted back the value for the input is null, which is of course the desired state.



In sum, this is strictly a cosmetic problem. Functionally the page behaves the same on the problem machine as it does everywhere else.



I originally assumed that this problem was due to the problem machine having a version of IE that no other machine in our building had (v11.0.60). But after upgrading the problem machine and some other machines to IE 11.0.70 the problem still remains on just the problem machine. Other machines with the same IE 11.0.70 behave properly.



I've searched through the myriad IE settings, but cannot find anything different on the problem machine.



Is anyone else having this problem? Any hints on how to even debug an issue like this is much appreciated.





@pendo Would you like to turn that into an answer? Rephrasing for politeness and adding some explanation would make it quite a decent one.
– Yunnosch
Aug 10 at 16:43




1 Answer
1



IE 11 doesn't always follow the rules. If you switch it to:


$("#id").prop("disabled","disabled");



It will work in IE.



If you only want to run that code for IE 11 or lower, here is a way to do that from another good post.
How to load a script only in IE





This fixes the issue on our problem machine, so I'm marking it as the answer, but of course I've changed the question, what I'd really like to know is "why is this happening on only one machine?"
– Tom Regan
Aug 10 at 21:17






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard