'input type text value into multiple lines
How to allow multiple line texts for input type=text?
For example, I have text called "my name is krishna and I am new to here"
This is the input text value I want to display in multiple lines.
Like :
myname is krishna </br>
and I am new to here
I have tried
word-wrap: break-word;
word-break: break-all;
white-space: pre-wrap;
Would need some ideas to do this. How can we achieve input type is text wrapping into multiple lines.
Solution 1:[1]
Use a textarea to handle multiple line span
<textarea id="someId" name="someName" cols="20" rows="6"></textarea>
and then jQuery to get the formatting
var htmlCode = $("#someId").html();
Solution 2:[2]
I think you should properly look into textarea. Both of them works the same way.
<textarea cols="5" rows="20"></textarea>
It also allows you to control the number of cols and rows of the input
If you are using contactform7, this is the shorthand code to include.
[textarea your-message 40x10 "your message here ..."]
More can be found Here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Danyal Imran |
| Solution 2 | Tree Nguyen |
