-1

I am trying to make an input text box with of 10 lines, but I can not make it and I have no idea what is going worng with it.
Comment box input type="text" style="width: 300px;" class="form-control" name="commentText" id="field_commentText" [(ngModel)]="comment.commentText" required minlength="2" maxlength="65000"

How can I fix it?

 <div class="form-group">
    <label class="form-control-label" jhiTranslate="jhipsterPress08App.comment.commentText" for="field_commentText">Comment Text</label>
        <input type="text" style="width: 300px;" class="form-control" name="commentText" id="field_commentText"
                                            [(ngModel)]="comment.commentText" required minlength="2" maxlength="65000"/>
            <div [hidden]="!(editForm.controls.commentText?.dirty && editForm.controls.commentText?.invalid)">
            <small class="form-text text-danger"
                                            [hidden]="!editForm.controls.commentText?.errors?.required" jhiTranslate="entity.validation.required">
                                            This field is required.
            </small>
            <small class="form-text text-danger"
                                            [hidden]="!editForm.controls.commentText?.errors?.minlength" jhiTranslate="entity.validation.minlength" translateValues="{ min: 2 }">
                                            This field is required to be at least 2 characters.
            </small>
            <small class="form-text text-danger"
                                            [hidden]="!editForm.controls.commentText?.errors?.maxlength" jhiTranslate="entity.validation.maxlength" translateValues="{ max: 65000 }">
                                            This field cannot be longer than 65000 characters.
            </small>
        </div>

Thanks

Jorge M. Nures
  • 680
  • 1
  • 14
  • 30

3 Answers3

1

I guess you are looking for textarea.

<textarea id="comment" cols="40" rows="10"></textarea>
Peter
  • 314
  • 1
  • 11
1

Multi-line input fields are created with the textarea tag.

A text area with 10 lines will look something like this:

<textarea rows="10" cols="50">
    A bunch of text goes here.
</textarea>
Adam
  • 3,829
  • 1
  • 21
  • 31
1

Normally a textarea is used for 2 or more lines.

<div class="form-group">
    <label class="form-control-label" jhiTranslate="jhipsterPress08App.comment.commentText" for="field_commentText">Comment Text</label>
    <textarea class="form-control" name="commentText" id="field_commentText" rows="10" cols="80"></textarea>
</div>
bron
  • 1,457
  • 1
  • 9
  • 18