View Full Version : wrap="off" not valid XHTML 1.0. What to use?

02-21-2004, 08:44 PM
Does anybody know what I can use instead of wrap="off" to put some code in a textarea that could be valid XHTML 1.0? Thanks.

02-21-2004, 11:46 PM

02-27-2004, 05:06 PM
Sorry if I didn't answer before. That's not what I need. I just have to write some javascript code in a textarea and I want the text inside to be as long as I need without returns. I think wrap="off" is the only solution but it's not valid.:mad:

02-27-2004, 05:16 PM
Can you show the error you get when you try to validate it? As far as I'm aware wrap="off" is valid

02-27-2004, 06:14 PM
It's not.

<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
<!ATTLIST textarea
rows %Number; #REQUIRED
cols %Number; #REQUIRED
disabled (disabled) #IMPLIED
readonly (readonly) #IMPLIED
onselect %Script; #IMPLIED
onchange %Script; #IMPLIED
>No wrap in there. For those of you that don't speak DTD, 'wrap' should appear in that list in the lefternmost column if it was an attribute of textarea.

This is XHTML1.1 though...

03-03-2004, 12:33 PM
This is what the W3C validator gives for a XHTML 1.0 Trans doc:

Line 267, column 35: there is no attribute "wrap" (explain...).
<textarea cols="50" rows="15" wrap="off" readonly="readonly">

I think there is not a walk-around for it.

Alex Vincent
03-03-2004, 07:20 PM
I'm sorry to say guys that you're right. I bumped into this issue about a year ago, and it's something they changed in the XHTML DTD.

The really lousy part about it is the CSS specification doesn't have a way around it either, I think. You might try overflow: scroll, but I have little confidence that will work.