2011-07-29 37 views
-3

当我们点击一​​个下拉菜单时,我们看不到光标,我们只是看到整个框中的值被选中,我们可以做到与文本字段相同,因为在文本字段中,我看到光标闪烁。将文本字段设置为选择框

如果感到困惑,请参阅图片。 :d enter image description here

+0

您的图像不显示。为什么不只是发布代码? – Henry

+0

所以你只是想从文本框中移除光标? – jasalguero

+0

@jasakguero怎么样?我做了但现在我不能移动到下一个字段使用制表键 –

回答

2

您是不是要找要禁用文本输入字段? (这就是我能想到的)。试试这个:

<input type="text" disabled="true" /> 

你想完成什么?

编辑:只读:

<input type="text" value="Some value" readonly="readonly" /> 

我认为这是你在找什么。只读没有焦点。

<input type="text" value="Some value" onfocus="this.blur()" readonly="readonly" /> 

编辑3,解决Tab键索引问题:

Previous field: <input type="text" tabindex=1/> 
Disabled field: <input type="text" value="Some value" onfocus="this.blur()" readonly="readonly" /> 
Next Field:  <input type="text" tabindex=2/> 
相关问题