Readonly
Posted by admin | Posted in HTML Tutorial | Posted on 11-08-2010-05-2008
0
We can make an input field as read only if we want the user not to interfere with the text written. We give the value of readonly attribute as true to make it readonly and then the user can not manipulate the data inside the input field.
This attribute is only for textbox and textarea input types.
Example:
- <textarea cols=”20″ rows=”5″ wrap=”hard” readonly=”yes”> As you can see many times word wrapping is often the desired look for your text areas. Since it makes everything nice and easy to read.</textarea>
Disabled
As the readonly attribute disables text manipulation, we can take things one step further by setting the disabled attribute. This grays out the input field altogether and inhibits any change in the text as well as text highlighting.
This attribute can be used for most of the input fields including the buttons.
Example:
- <textarea cols=”20″ rows=”5″ wrap=”hard” disabled=”yes”>As you can see many times word wrapping is often the desired look for your text areas. Since it makes everything nice and easy to read.</textarea>
