anatak Posted February 28, 2008 Share Posted February 28, 2008 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 https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/ Share on other sites More sharing options...
aximbigfan Posted February 28, 2008 Share Posted February 28, 2008 just put readonly in the brackets, don't give it any arguments, <textarea readonly></textarea> EDIT: I read it wrong, yes I think it is a standard atrribute, at least it should work on all modern browsers. Chris Link to comment https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/#findComment-479120 Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 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 https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/#findComment-479143 Share on other sites More sharing options...
anatak Posted February 28, 2008 Author Share Posted February 28, 2008 thank you, the text area field works without problems but I only tested in firefox 2 and IE6 Thanks for the replies Link to comment https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/#findComment-479580 Share on other sites More sharing options...
alynu Posted February 13, 2011 Share Posted February 13, 2011 the correct term is readonly="true" c ya Link to comment https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/#findComment-1173481 Share on other sites More sharing options...
Pikachu2000 Posted February 13, 2011 Share Posted February 13, 2011 No it isn't, it's readonly="readonly". And was it really necessary to dredge up a 3 year old thread to post the wrong information? Locked. Link to comment https://forums.phpfreaks.com/topic/93510-textarea-readonlyreadonly/#findComment-1173482 Share on other sites More sharing options...
Recommended Posts