i have this text box
<p>Event Data :<input id="data" type="text" wrap="true" value="{{data}}"
style="width: 757px; height: 170px" />
</p>
i want it to be multiline
i can't use asp:textbox
is it possible to use exact textbox and make it multiline or
make the text in textbox go word wrap
How about this:
<p>Event Data:
<textarea id="data" style="width: 757px; height: 170px" rows="10" cols="80">{{data}}</textarea>
</p>
Hat tip (and +1) to Stewart for pointing out that rows
and cols
are required attributes to textarea
.
<p>Event Data:
<textarea id="data" rows="10" cols="80">{{data}}</textarea>
</p>
rows and cols are required attributes. Don't ask me why. And if you're going to set the size in CSS, it's generally better to do it in em or % rather than px.
If you mean that you want your text values to display as multi-lines, use add a white-space: pre;
style to the textarea element, making sure to put put the proper line-breaks into the returned {{data}}
You will need to use a <textarea>
with a wrap
attribute. It is not in any HTML standard but to my knowledge the settings "soft", "hard" and "off" work in all major browsers. Definitely in IE. Firefox seems to require a "cols" setting for wrap to work, though.