Jump to content

textarea readonly="readonly"


anatak

Recommended Posts

Hello

I want a textarea field that displays text but that not let users modify the text.

 

disabled makes the text appear on a grey field which is not desirable.

 

I came across the readonly="readonly" attribute but could not find info on the w3schools page about it.

 

Is this supported across all browsers ?

Is this an official attribute of the HTML specifications ?

 

thank you

anatak

Link to comment
Share on other sites

That should actually look like this (if you want valid code):

 

<textarea readonly="readonly" cols="___" rows="___">Text to only be read</textarea>

 

you have to fill in numbers for cols and rows.

 

Edit: in otherwords, the OP had the correct code. And yes, I think this is supported across all browsers.

Link to comment
Share on other sites

  • 2 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.