How to set min and max allowed number of characters in field?