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..
The :read-only selector selects elements which are "readonly". Form elements with a "readonly" attribute are defined as "readonly".
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.
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 can you make a textbox readonly using JQuery? $('#TextBoxId'). attr('readonly', 'true'); 1.
For people coming to this answer now. You can do this now with
pointer-events: none;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With