Problem while removing readonly in Internet Explorer

Asked

Viewed 96 times

2

I have a function that removes the readonly of a field after focusing the same: $input.removeAttr('readonly');

The problem is that only in Internet Explorer even after removing readonly it does not allow me to type in the field. The problem only solves if I leave the field and focus it again. I would like a solution where I do not have to use the event blur and focus, because I have other behaviors involving the function blur.

  • Have you tried using the input disabled ? Example fiddle: https://jsfiddle.net/fvtgmxv7/2/

  • I couldn’t reproduce the error in IE 11.0, but try $input.prop('readonly',false), See here

  • @abfurlan the problem occurs if the focus is already in the field and dynamically the effect is removed. Simply clicking on the field already solves the problem

  • @abfurlan that: http://jsfiddle.net/9050m0La/3/

  • try to use the removeAttribute: http://jsfiddle.net/h5jfhbk4/6/

1 answer

0

You must use $input.prop('readonly', false);

Usa .prop instead of .attr for the readonly is a native property of the element and its state is set and read via .prop().

  • even with .prop continues with the same problem

  • 1

    @Rubydevjunior makes a jsFiddle that plays the problem, tells you which version of IE and puts here that I take a look.

  • follow http://jsfiddle.net/h5jfhbk4/6/ I am using IE 12 to simulate by clicking the field and trying to type. In other browsers releases typing after 3 seconds, in IE no, it is necessary to click again in the @Sergio field

Browser other questions tagged

You are not signed in. Login or sign up in order to post.