Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set readonly property of textbox from css

Tags:

css

i create css code like

.inputHide {
    font-size       : 100px;
    width           : 100px;
    height          : 100px;
    border          : none;
    background      : transparent;
    readonly        : true;
}

But it does not work. Although if i use font-size of 1px then by using tab i can access that textbox & can change it's value.

Is there any way to make textbox readonly just using css..

like image 358
PHP Ferrari Avatar asked Mar 27 '10 07:03

PHP Ferrari


People also ask

How do I make a TextBox readonly in CSS?

The :read-only selector selects elements which are "readonly". Form elements with a "readonly" attribute are defined as "readonly".

How do you readonly a text box?

Set the TextBox control's ReadOnly property to true . With the property set to true , users can still scroll and highlight text in a text box without allowing changes.

How do you make a Div readonly in CSS?

To make <input /> tag completely un-editable, put readonly attribute on the tag. Below is simple example to do it by using jQuery . prop() . You can also put the attribute directly on the tag, depending on the needs.

How do you make a text box readonly in JQuery?

How can you make a textbox readonly using JQuery? $('#TextBoxId'). attr('readonly', 'true'); 1.


1 Answers

For people coming to this answer now. You can do this now with

pointer-events: none;
like image 134
J D Avatar answered Oct 12 '22 01:10

J D