Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase height of textarea using bootstrap rows and columns

I have designed a form in which I have two items in a row, like this:

My output

enter image description here

Code that I used:

<div class="row">
    <div class="col-sm-3">  <!-- [1, 0] -->
        <fieldset class="form-group">
            <label id="fieldTitle">Equipment Length</label>
            <select id="selectOption" class="form-control" required data-error="Please select Equipment Length"></select>
            <div class="help-block with-errors"></div>
        </fieldset>
    </div>
    <div class="col-sm-9">  <!-- [1, 1] -->
        <fieldset class="form-group">
            <label id="fieldTitle">Customer Notes</label>
            <textarea class="form-control" placeholder="Please write customer notes" ng-model="myTextarea" required data-error="Please enter customer notes"></textarea>
            <div class="help-block with-errors"> {{myTextarea}} </div>
        </fieldset>
    </div>
</div>

So, please guide me how do I increase the height of the textarea just like my

desired output enter image description here please tell me how do I do it. Thanks

like image 281
Sikandar Sahab Avatar asked Feb 01 '18 08:02

Sikandar Sahab


People also ask

How can I increase width and height of textarea?

The size of a textarea can be specified by the cols and rows attributes, or even better; through CSS' height and width properties. The cols attribute is supported in all major browsers.

How do I change the height of my text area?

It can be achieved by using JavaScript and jQuery. Method 1: Using JavaScript: To change the height, a new function is created which changes the style property of the textarea. The height of the textarea is first set to auto. This value makes the browser set the height of an element automatically.

How do I enlarge textarea in HTML?

There are two ways of setting the size of the HTML <textarea> element. You can use HTML or CSS. In HTML, you can use the cols and rows attributes.


1 Answers

With Bootstrap 4 you will need to have the property rows and add "height: 100%;" so that the height would stretch to the number of rows specified. "rows" along does not work.

<textarea rows="10" style="height:100%;"></textarea>
like image 79
user3399299 Avatar answered Oct 19 '22 08:10

user3399299