- 
                Notifications
    You must be signed in to change notification settings 
- Fork 18
Client side validation messages
The following is the list of English-language Client side validation messages. The messages are part of the wcomponents-i18n project and may be overridden per application.
TODO This is now part of the components-i18n module and should be updated accordingly. The content is still applicable as at 1.4.
In the table below the leading %s character is replaced by the content of the label for the component unless noted otherwise. Where the label text is used it does not include the hint of the label (if any) but does include accessible text of the component (or label) if any such text exists. This is to ensure that the error message accurately reflects the full intent of the label for all users. If a component is unlabelled the the text "This field " (with a single trailing space) is prefixed to the message unless specified otherwise.
| Message text | Component(s) | Condition(s) to trigger message | Notes | 
|---|---|---|---|
| %smust be completed. | Any required component (except WFieldSet, WFileWidget and WMultiSelectPair) | component not 'complete' | |
| %sis not in the required format. | WTextField, WPasswordField, WPhoneNumberField or WMultiTextField with the patternproperty set to a regular expression | The component has content entered but the content does not correspond to the pattern | |
| %smust have at least one field completed. | WFieldSet with its requiredproperty set true | no control in an interactive state and available to the user in the fieldset is in a 'complete' state | %sis the legend of the fieldset output by the WFieldSet's WDecoratedLabel | 
| You have reached the maximum options to select. | WMultiTextField and WMultiDropdown with the maxproperty set | The user attempts to add max+ 1 options | This is used in an alert when the max+ 1th option is added. | 
| %1$smust have no more than%2$soptions selected. | WCheckBoxSelect, WMultiDropdown and WMultiSelect with the maxproperty set | More than maxoptions have been selected | %1$sis replaced with the label text,%2$swith the value of themaxproperty | 
| %1$smust have at least%2$soptions selected. | WCheckBoxSelect, WMultiDropdown and WMultiSelect with the minproperty set | at least one but fewer than minoptions have been selected | %1$sis replaced with the label text,%2$swith the value of theminproperty | 
| %1$s- $2%s | WPartialDateField | used in next message | This is an indicator of the range of month in a year, for example Jan - Dec or Ionawr i Rhagfyr. | 
| %1$smust include at least one of a date (1-31) and/or month (1-12 or%2$s) and/or year (for example%3$d). | WPartialDateField | The user has entered text which cannot be parsed to a partial date using any supported parsing regex. %1Ssis the text content of the label,%2$sis the month range as per the preceding message,%3$dis the current year as a four digit integer. | |
| %smust be a full date with day, month and year. | WDateField | The user has entered text which cannot be parsed to a date using any supported parsing regex | |
| %1$smust be on or after%2$s | WDateField with minset | The user has entered a date but it is before the date specified by the minproperty | %1$sis replaced with the label text,%2$swith the value of theminproperty. Not applicable to WPartialDateField the input to which cannot be deemed to be a date and is therefore not capable of being compared. | 
| %1$smust be on or before%2$s | WDateField with maxset | The user has entered a date but it is later than the date specified by the maxproperty | %1$sis replaced with the label text,%2$swith the value of themaxproperty. Not applicable to WPartialDateField the input to which cannot be deemed to be a date and is therefore not capable of being compared. | 
| %1$sis limited to%2$scharacters and currently%3$dare entered. | WTextArea with maxspecified | The user has entered more than maxcharacters | %1$sis replaced with the label text,%2$swith the value of themaxproperty and%3$swith the number of characters entered by the user. This error can only be triggered in user agents which do not support maxlength on the textarea element such as Internet Explorer before version 10. | 
| The file you have selected is too large ( %sbytes).\nMaximum file size is%s(bytes). | WFileWidget with maxFileSizeproperty set | The user attempts to upload a file larger than permitted by maxFileSize | The first %sis the file size, the second is the value ofmaxFileSize. The message is displayed in an alert box | 
| The file you have selected is not of an accepted type.\nOnly the following type/s are accepted: %s. | WFileWidget with acceptedMimeTypesproperty set | The user attempts to upload a file which is not of a type permitted by acceptedMimeTypes | %sthe value ofacceptedMimeTypes. The message is displayed in an alert box | 
| %smust have at least one file uploaded. | WFileWidget with its requiredproperty set true | The user has not uploaded any files | |
| %1$smust have no more than%2$svalues entered. | WMultiTextField with the maxproperty set | More than maxoptions have been selected | %1$sis replaced with the label text,%2$swith the value of themaxproperty | 
| %1$smust have at least%2$svalues entered. | WMultiTextField with the minproperty set | at least one but fewer than minoptions have been selected | %1$sis replaced with the label text,%2$swith the value of theminproperty | 
| %1$smust have at least one option added to the%2$slist. | WMultiSelectPair with the requiredproperty set true | The user does not select any options | %1$sis replaced with the WMultiSelectPair's label text and%s$2 with the value of thetoListNameproperty | 
| %1$smust have no more than%2$soptions in the%3$slist. | WMultiSelectPair with the maxproperty set | The user selects more than maxoptions | %1$sis replaced with the WMultiSelectPair's label text,%s$2 with the value of themaxproperty and%3$swith the value of the WMultiSelectPair'stoListNameproperty | 
| %1$smust have at least%2$soptions in the%3$slist. | WMultiSelectPair with the minproperty set | The user selects at least one but fewer than minoptions | %1$sis replaced with the WMultiSelectPair's label text,%s$2 with the value of theminproperty and%3$swith the value of the WMultiSelectPair'stoListNameproperty | 
| %1$smust be at least%2$s. | WNumberField with the minproperty set | The user enters a number below min | %1$sis replaced with the label text,%2$swith the value of theminproperty | 
| %1$smust be no more than%2$s. | WNumberField with the maxproperty set | The user enters a number above max | %1$sis replaced with the label text,%2$swith the value of themaxproperty | 
| %1$smust be between%2$sand%3$s. | WNumberField with both the minandmaxproperty set | The user enters a number below minor abovemax | %1$sis replaced with the label text,%2$swith the value of theminproperty and%3$swith the value of themaxproperty | 
| %smust be a number. | WNumberField which does not have a maxorminproperty set | The user enters content which is not a number as understood by the user agent | This message will only appear in user agents which do not support native input of type number such as Internet Explorer below version 10 | 
| %1$smust be a number of at least%2$s. | WNumberField which has a minbut not amaxproperty set | The user enters content which is not a number as understood by the user agent | %1$sis replaced with the label text,%2$swith the value of theminproperty. This message will only appear in user agents which do not support native input of type number such as Internet Explorer below version 10 | 
| %1$smust be a number no more than%2$s. | WNumberField which has a maxbut not aminproperty set | The user enters content which is not a number as understood by the user agent | %1$sis replaced with the label text,%2$swith the value of themaxproperty . This message will only appear in user agents which do not support native input of type number such as Internet Explorer below version 10 | 
| %1$smust be a number between%2$sand%3$s. | WNumberField which has both maxandminproperties set | The user enters content which is not a number as understood by the user agent | %1$sis replaced with the label text,%2$swith the value of theminproperty and%3$swith the value of themaxproperty. This message will only appear in user agents which do not support native input of type number such as Internet Explorer below version 10 | 
| %smust be an email address. | WEmailField | The user enters content which does not meet a simple regular expression test to determine if the entered text is likely to be an email address. | |
| %1$smust contain a minimum of%2$scharacters. | WTextField, WPasswordField, WEmailField, WPhoneNumberField, WTextArea and WMultiTextField with the minproperty set | The user enters at leasr one character but fewer than mincharacters | %1$sis replaced with the label text,%2$swith the value of theminproperty. | 
- Mandatory label marker (note: this should NEVER appear in a prod application): "This component requires a label.".
- Submit on change warning message (NOTE: this is mandatory and must never be removed though the exact wording may change): "Changing the value or selection of this component will cause all of your changes to be saved immediately.".
- Generic mandatory field incomplete message: "%smust be completed.".
- Prefix for generic mandatory field incomplete message if the field has not been correctly labelled: "This field ".
- Error message concatenator: %1$sand%2$s
- Error message when a multi selection component has more than the allowed maximum number of selections: "%1$smust have no more than%2$soptions selected.".
- Error message when a multi selection component has fewer than the required minimum number of selections: "%1$smust have at least%2$soptions selected.".
- Suffix for unsaved changes warning: " has unsaved changes. Would you like to discard them?".
- Prefix for unsaved changes warning if the page does not have a title (note: this is an error state and should not happen in any production application): "This page".
Some user agents may undertake client side validation of input for some form controls under some conditions. The user agent may or may not output a message to the user. Where such a message is output the format, content and appearance of the message is not directly configurable by any WComponents application.
Where a WComponent implements Client side validation we attempt to explicitly prevent user agent messaging for the same validation errors. We do not, however, make any attempt to prevent the user agent from overriding or preventing invalid entry nor do we explicitly prevent a user agent from undertaking any content validation or supplying any message to users whilst they interact with their software.