Forum Moderators: open

Message Too Old, No Replies

Text box readonly input -- keep the cursor out?

         

Argblat

8:14 pm on Apr 13, 2005 (gmt 0)

10+ Year Member



I am wondering if, when creating a form text input that is readonly, it is possible to keep the cursor from appearing in the text box.

As I currently have it implemented, the text box is read only, but the type cursor (the I cursor), still appears in the input box if you click on it. It seems to me that this has the potential to be confusing (ignoring color changes and other visual cues), I would like to be able to diable this if it is possible

Thank in advance for any help,
Mike

treeline

9:36 pm on Apr 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not just set that input text to "hidden" so it gets sent along with the query, but doesn't confuse your users?

BlobFisk

11:32 am on Apr 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can disable a text input, which will not only make it look like a non-active element but also prevent it getting focus:

<input type="text" .... disabled="disabled">

HTH

rocknbil

3:55 pm on Apr 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<input type="text" name="displayOnly" size="25" maxlength="25" value="" onFocus="blur();">

Sorry don't know what to do about the cursor. Sometimes visitors just have to figure it out. :-)

Purple Martin

2:36 am on Apr 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rocknbil's suggestion relys on the user having JavaScript turned on. BlobFisk's solution will always work.