I currently have a textarea
in my project that allows users to input text using Bootstrap. However, the height of the textarea is fixed at 3 rows by default. I want to make it dynamic so that as the user types beyond 3 rows, the textarea expands instead of showing a vertical scroll bar. I am aware that the textarea is responsive and can be resized by the user. But, I plan to implement a print feature where users can generate a PDF of their input, which is why the limited row setting is inconvenient.
Below is the code snippet:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<title>Index</title>
</head>
<body>
<div class="container">
<div class="container row text-center">
<div class="container col bg-primary text-light"><span style="font-size: 5rem;">S</span></div>
</div>
<div class="container row text-center">
<div class="container col bg-primary text-light"><span style="font-size: 2rem;">STRENGTHS</span></div>
</div>
<div class="container row text-center">
<div class="container col bg-primary text-light"><span style="font-size: 2rem;">
<form>
<div class="form-group">
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
</div>
</form>
</span></div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/popperjs/dist/umd/popper.min.js"
integrity="sha384-W8fXfP3gkOKtndU4JGtKDvXbO53Wy8SZCQHczT5FMiiqmQfUpWbYdTil/SxwZgAN"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.min.js"
integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/"
crossorigin="anonymous"></script>
</body>
</html>