add pattern, minLength and maxLength