Hi all,
I have read the page of François Planque concerning the nightmare of IE and Textareas (which I am experiencing right now). http://fplanque.net/2003/Articles/iecsstextarea/
By using one of the tecnic there I solved my problem when editing a new text, but I still have the problem when charging the page with a textarea full of text where 1 line is really big.
Example :
<form action="someAction">
<fieldset style="border:none;padding:0;">
<label>
Code:
<textarea id="code" rows="30" style="width:95%;" >SomeReallyBigLineWayTooLargeWithoutAnySingleSpace</textarea>
</label>
</fieldset>
</form>
When the server send a page with pre-loaded text in the textarea, the problem comes back, but when editing a new one where the textarea is empty, everything works fine even if I paste a 8000 cars line. Anyone have an idea how I could correct that?
Thanks
Ok, I found a solution to my problem and also why it was occuring. For those interested, here`s what I found on the subject:
[quote]
The rules for calculating widths are given in the CSS spec, and in the
case of the example above, boil down to:
1. width: 100%; on the input element means 100% of its parent, which
is the td.
2. The width of the td is the width of its contents, in this case the
input.
3. The width of the table is the greater of its defined width (100%)
and the width of all its cells (i.e. the width derived in step 2).
1 and 2 are obviously circular and the browser (whichever one it is
that you're using) has decided that give priority to the width of the
contents. This is perfectly in line with the CSS specs.
[/quote]
So, with that explanation for an input, I found that by wrapping the textarea in a table with the style attribute table-layout set to fixed (<table style="table-layout:fixed; width:100%">), IE don`t use the content of the textarea to compute the width event if this one is set to 95%.