在< input>中使用readonly属性而不用改变光标 [英] Use readonly attribute in <input> without changing the cursor
本文介绍了在< input>中使用readonly属性而不用改变光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我的< input>
字段含有只读属性
属性,它仍然与I-光束文本光标。有没有办法停止显示光标?
我不能使用 disabled
属性,因为 request.getParameter()
在禁用的字段中不起作用。
< input type =textvalue =testonfocus =this.blur()readonly = readonly/>
可帮助您隐藏游标的主要内容是onfocus =this.blur()。
If I have an <input>
field with the readonly
attribute, it still appears with the I-beam text cursor. Is there a way to stop that cursor from showing?
I cant use the disabled
attribute because request.getParameter()
does not work on disabled fields.
解决方案
Try this markup in your form for text field
<input type="text" value="test" onfocus="this.blur()" readonly="readonly" />
main thing which helps you hide the cursor is onfocus="this.blur()".
这篇关于在< input>中使用readonly属性而不用改变光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文