2011-07-29 28 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/> 
相關問題