I think itโs important to understand that setting height: 100%for a text field will only work in IE if you explicitly set it to quirks mode, although it works as expected in Firefox. The W3C states that the size of the text field is determined in lines, not pixels, etc.
, , , , .., , , . - JS . .
<html>
<head runat="server"><title>Look, Mom! No Scrollbars!</title></head>
<body onload="resizeTextArea()" onresize="resizeTextArea()">
<form id="form1" runat="server">
<div id="formWrapper" style="height:200px">
<input type="text" value="test" />
<input type="text" value="test" />
</div>
<textarea id="area" style="width: 100%"></textarea>
</form>
<script type="text/javascript">
function resizeTextArea() {
var heightOfForm = document.getElementById('formWrapper').offsetHeight;
var heightOfBody = document.body.clientHeight;
var buffer = 35;
document.getElementById('area').style.height =
(heightOfBody - heightOfForm) - buffer;
}
</script>
</body>
</html>
. FF, IE.
, !