Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

More than 1 row in <Input type="textarea" />

I'm having troubles getting my <input type="textarea" /> to have more than 1 row,

I tried adding the properties in the html, like you would do with a normal <textarea></textarea> like this: <input type="textarea" rows="x" cols="x" />

I even tried to do it in CSS, but it did not work. I've searched all over the internet for a solution, but i can't seem to find a topic regarding my exact problem anywhere.

The textareas i'm experiencing this with, are on this website: Vilduhelst

When you press the "Lav dit eget dilemma" button they will appear.

I'm looking for either a HTML or CSS solution.

like image 305
Jonas Pedersen Avatar asked Oct 26 '12 14:10

Jonas Pedersen


People also ask

Can we use textarea in input type?

The <textarea> tag defines a multi-line text input control. The <textarea> element is often used in a form, to collect user inputs like comments or reviews. A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).

What is rows in textarea?

The HTML textarea rows Attribute is used to specify the number of visible text lines for the control i.e the number of rows to display. It also specifies the visible height of the Textarea.

What is rows and cols in textarea?

rows/cols is based on the character size of the user. So if you have a css-defined width/height that cannot be divided by the pixles of a character in the textarea, there is going to be that much whitepsace left over vertically and horizontally.

What is the meaning of rows attribute in textarea tag?

The rows attribute specifies the visible height of a text area, in lines. Note: The size of a textarea can also be specified by the CSS height and width properties.


Video Answer


2 Answers

Why not use the <textarea> tag?

​<textarea id="txtArea" rows="10" cols="70"></textarea> 
like image 106
Vinod Vishwanath Avatar answered Sep 28 '22 03:09

Vinod Vishwanath


Although <input> ignores the rows attribute, you can take advantage of the fact that <textarea> doesn't have to be inside <form> tags, but can still be a part of a form by referencing the form's id:

<form method="get" id="testformid">     <input type="submit" /> </form>  <textarea form ="testformid" name="taname" id="taid" cols="35" wrap="soft"></textarea> 

Of course, <textarea> now appears below "submit" button, but maybe you'll find a way to reposition it.

like image 28
AdamL Avatar answered Sep 28 '22 05:09

AdamL