-3

When we click on a dropdown we dont see cursor, we just see the whole box with value gets selected, can we do same with text field because in text field I see the cursor blinking.

see image if confused. :D enter image description here

Rohit Sharma
  • 141
  • 1
  • 3
  • 10

3 Answers3

2

Did you mean you want to disable the text input field? (Thats what I can think). Try this:

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

What are you trying to accomplish?

Edit: Read only:

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

I think this is what you are looking for. Read only with no focus.

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

Edit 3, Solving Tab Index problem:

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/>
Roman
  • 3,764
  • 21
  • 52
  • 71
0

You should use jQuery UI's Autocomplete:

http://jqueryui.com/demos/autocomplete/#combobox

thirtydot
  • 224,678
  • 48
  • 389
  • 349
  • no no I already did auto complete, I want to make it readonly in such a way that user wont be able to click on the field. (so no blinking cursor) – Rohit Sharma Jul 29 '11 at 09:45
-1

If you do not want to use any javascript framework, you can create your own java script code for autocomplete. Please look into the example in this page --> AutoComplete text box autocomplete

Srinath
  • 164
  • 10