In my HTML code, users can enter comments for a specific question. If the comments are lengthy, I want the text box to automatically increase in height. Here is my current HTML code:
<label class="label-reports">Comments</label>
<input @((ViewBag.UserId != null && ViewBag.UserId == question.AnsweredBy) || (question.AnsweredBy == null) ? "" : "disabled") type="text" class="form-control" style="align-content:stretch; min-width:1200Px; width: auto !important" for="comments" value="@question.Comments" />
I attempted to use this code snippet:
<textarea class="form-control" rows="5"></textarea>*
However, my attempt was unsuccessful. Can anyone provide guidance on how to dynamically adjust the size of the text box based on the length of the input?