简体   繁体   English

IE 11中未设置只读值

[英]Readonly Value not set in IE 11

Hello this question may sound repeated, but I wasn't able to find the correct answer even after looking through a lot of posts. 您好,这个问题听起来可能很重复,但是即使看了很多帖子,我也找不到正确的答案。 I have a "read only" field in my app that is set using the data entered in to the other fields. 我的应用程序中有一个“只读”字段,使用在其他字段中输入的数据进行设置。

<input type=“number” class=“form-control” value=“{{it.depth.value*it.width.value*it.height.value}}“readonly>

It works in chrome but fails in IE 11 ie it doesn't display anything. 它可以在chrome中使用,但在IE 11中无法使用,即不显示任何内容。 Does anybody know why is that so, I know angular support was stopped from previous IE versions but I am using IE11 and it still doesn't work. 有人知道为什么吗,我知道以前的IE版本停止了角度支持,但是我正在使用IE11,但它仍然无法正常工作。 Thanks in advance 提前致谢

readonly input element doesn't work in IE old versions. readonly输入元素在IE旧版本中不起作用。 Use disabled instead. 使用disabled代替。

<input type=“number” class=“form-control” value=“{{it.depth.value*it.width.value*it.height.value}}“ disabled>

You can also try with readonly="readonly" for the input element: 您也可以尝试对input元素使用readonly="readonly"

<input type=“number” class=“form-control” value=“{{it.depth.value*it.width.value*it.height.value}}“ readonly="readonly">
<input type=“number” class=“form-control” value=“{{it.depth.value*it.width.value*it.height.value}}“ [attr.readonly]="true">

到目前为止,对于我来说,它可以在IE11中运行,请检查并告诉它是否对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM