Added #maxlength property to field so that the user cannot add more
characters than is needed for the proper pattern.