Validate minimum amount of characters in textarea?

0

Well, I need to validate a textarea field in an application using thymeleaf, to limit the maximum amount I've already achieved, but I do not know how to validate the minimum amount.

    
asked by anonymous 06.10.2017 / 23:35

1 answer

1

I was able to add minlength="" to the amount I needed that worked.

<textarea class="form-control" id="inputAnswer" placeholder="Enter Question" th:field="*{answer}" minlength="50" maxlength="255">
                            <span th:if="${#fields.hasErrors('answer')}" th:errors="*{answer}" th:class="help-block" />
</textarea>
    
07.10.2017 / 02:29