Read-only Textbox without Cursor

Read Only Text boxes can be used to prevent editing by User.

Making Textbox read-only by HTML readonly attribute



No value is needed for ‘readonly’ attribute but readonly=”readonly” will also work where attribute minimization is not allowed.

There is also a disabled attribute which disables a field . The field cannot be changed but you cannot get any data from that field when form is submitted.

Read-only is the best way to make an interactive field uneditable while still being able to get data from the field.

Only problem with above code is that Cursor/Caret/Pointer is still visible on selecting field .


Removing Cursor/Blinking Caret from field when Selected

You can easily removeĀ  cursor by using simple Javascript : onfocus=”this.blur()”

This will prevent your field from getting focused and thus remove the Cursor.