A field on our shopping cart needs to be limited by the number of characters entered in it. The field is optional, but if a user does enter text in it, it should behave as follows:
? If no text is entered, no checking is performed.
? If the user clears text that was previously entered, no checking is performed.
? If less than five characters are entered, an error is produced indicating that there need to be at least five characters.
? If five characters are entered, all of the characters should be numeric and an error produced if they are not. If six or more are entered, then the characters can be either alpha or numeric and no error is produced.
? Special characters and punctuation are not allowed in any scenario, and should produce an error if they are entered.