Hi I have a form with a text area for comments. The problem is my code below should produce a textbox 3 rows high but when it is displayed in Chrome it only ever appears as one line , Can anyone suggest what I am doing wrong please?
<tr>
<td > </td>
<td ><strong>App开发者_开发问答rover Comments</strong></td>
<td colspan="3" >
<textarea name="approvecom" cols="100" rows="5" autocomplete="OFF"></textarea>
</td>
<td > </td>
</tr>
Try using height and width CSS definitions to define the bounds of your textarea instead.
<textarea style="height:100px; width:300px;"></textarea>
I'd go with a dynamic solution using jQuery:
$("textarea").each(function(){
var rows = $(this).attr('rows');
var newHeight = rows * 30;
$(this).css({
"height": newHeight + 'px'
});
});
精彩评论