This is what I have tried:
nrkomp = IntegerField('Number',validators=[NumberRange(min=1, max=5, message='Invalid length')])
In developer tools, this form input has type text and not number, I have read the docs, but could not find a solution to this problem.