Been searching but not finding a solution.
I’ve a textarea, asp:textbox, which I try to remove the behavior that text is placed on a second row without the user doing a linebreak. I want it to continue on the same row even thou the textbox itself is not large enough to present all text as long as the user does not press return.
runat="server" Width="387" Height="40px" TextMode="MultiLine" onkeypress="MaxTwohundred(this);" Rows="2" style="overflow-x: scroll; overflow-y:
What is the proper way to accomplish this?
white-space:nowrap Does not do the trick.The user can then not do a simple linebreak by pressing the return button.
Thanks.
Edit
Thanks Tim Medora, it works.
Bellow is what I use.
TextMode="MultiLine"
style="overflow-x: scroll; overflow-y: hidden; " wrap="false"
See this sample: http://jsfiddle.net/nDtpL/4/
While it would be nice to use CSS
white-spaceto control this behavior, browser support is inconsistent (see comments). Instead, I’m usingwrap="off"to get the desired behavior (at least in my quick tests on Chrome, IE 9 (and 7 8 emulation mode), and FF).Here’s a similar thread: enter does not work in textarea in Internet Explorer 8