-
Notifications
You must be signed in to change notification settings - Fork 17
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 |
---|---|---|---|
%s must be completed. |
Any required component (except WFieldSet, WFileWidget and WMultiSelectPair) | component not 'complete' | |
%s is not in the required format. |
WTextField, WPasswordField, WPhoneNumberField or WMultiTextField with the pattern property set to a regular expression |
The component has content entered but the content does not correspond to the pattern | |
%s must have at least one field completed. |
WFieldSet with its required property set true |
no control in an interactive state and available to the user in the fieldset is in a 'complete' state |
%s is the legend of the fieldset output by the WFieldSet's WDecoratedLabel
|
You have reached the maximum options to select. |
WMultiTextField and WMultiDropdown with the max property set |
The user attempts to add max + 1 options |
This is used in an alert when the max + 1th option is added. |
%1$s must have no more than %2$s options selected. |
WCheckBoxSelect, WMultiDropdown and WMultiSelect with the max property set |
More than max options have been selected |
%1$s is replaced with the label text, %2$s with the value of the max property |
%1$s must have at least %2$s options selected. |
WCheckBoxSelect, WMultiDropdown and WMultiSelect with the min property set |
at least one but fewer than min options have been selected |
%1$s is replaced with the label text, %2$s with the value of the min property |
%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$s must 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. %1Ss is the text content of the label, %2$s is the month range as per the preceding message, %3$d is the current year as a four digit integer. |
|
%s must 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$s must be on or after %2$s
|
WDateField with min set |
The user has entered a date but it is before the date specified by the min property |
%1$s is replaced with the label text, %2$s with the value of the min property. Not applicable to WPartialDateField the input to which cannot be deemed to be a date and is therefore not capable of being compared. |
%1$s must be on or before %2$s
|
WDateField with max set |
The user has entered a date but it is later than the date specified by the max property |
%1$s is replaced with the label text, %2$s with the value of the max property. Not applicable to WPartialDateField the input to which cannot be deemed to be a date and is therefore not capable of being compared. |
%1$s is limited to %2$s characters and currently %3$d are entered. |
WTextArea with max specified |
The user has entered more than max characters |
%1$s is replaced with the label text, %2$s with the value of the max property and %3$s with 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 (%s bytes).\nMaximum file size is %s (bytes). |
WFileWidget with maxFileSize property set |
The user attempts to upload a file larger than permitted by maxFileSize
|
The first %s is the file size, the second is the value of maxFileSize . 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 acceptedMimeTypes property set |
The user attempts to upload a file which is not of a type permitted by acceptedMimeTypes
|
%s the value of acceptedMimeTypes . The message is displayed in an alert box |
%s must have at least one file uploaded. |
WFileWidget with its required property set true |
The user has not uploaded any files | |
%1$s must have no more than %2$s values entered. |
WMultiTextField with the max property set |
More than max options have been selected |
%1$s is replaced with the label text, %2$s with the value of the max property |
%1$s must have at least %2$s values entered. |
WMultiTextField with the min property set |
at least one but fewer than min options have been selected |
%1$s is replaced with the label text, %2$s with the value of the min property |
%1$s must have at least one option added to the %2$s list. |
WMultiSelectPair with the required property set true |
The user does not select any options |
%1$s is replaced with the WMultiSelectPair's label text and %s $2 with the value of the toListName property |
%1$s must have no more than %2$s options in the %3$s list. |
WMultiSelectPair with the max property set |
The user selects more than max options |
%1$s is replaced with the WMultiSelectPair's label text, %s $2 with the value of the max property and %3$s with the value of the WMultiSelectPair's toListName property |
%1$s must have at least %2$s options in the %3$s list. |
WMultiSelectPair with the min property set |
The user selects at least one but fewer than min options |
%1$s is replaced with the WMultiSelectPair's label text, %s $2 with the value of the min property and %3$s with the value of the WMultiSelectPair's toListName property |
%1$s must be at least %2$s . |
WNumberField with the min property set |
The user enters a number below min
|
%1$s is replaced with the label text, %2$s with the value of the min property |
%1$s must be no more than %2$s . |
WNumberField with the max property set |
The user enters a number above max
|
%1$s is replaced with the label text, %2$s with the value of the max property |
%1$s must be between %2$s and %3$s . |
WNumberField with both the min and max property set |
The user enters a number below min or above max
|
%1$s is replaced with the label text, %2$s with the value of the min property and %3$s with the value of the max property |
%s must be a number. |
WNumberField which does not have a max or min property 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$s must be a number of at least %2$s . |
WNumberField which has a min but not a max property set |
The user enters content which is not a number as understood by the user agent |
%1$s is replaced with the label text, %2$s with the value of the min property. 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$s must be a number no more than %2$s . |
WNumberField which has a max but not a min property set |
The user enters content which is not a number as understood by the user agent |
%1$s is replaced with the label text, %2$s with the value of the max property . 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$s must be a number between %2$s and %3$s . |
WNumberField which has both max and min properties set |
The user enters content which is not a number as understood by the user agent |
%1$s is replaced with the label text, %2$s with the value of the min property and %3$s with the value of the max property. This message will only appear in user agents which do not support native input of type number such as Internet Explorer below version 10 |
%s must 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$s must contain a minimum of %2$s characters. |
WTextField, WPasswordField, WEmailField, WPhoneNumberField, WTextArea and WMultiTextField with the min property set |
The user enters at leasr one character but fewer than min characters |
%1$s is replaced with the label text, %2$s with the value of the min property. |
- 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: "
%s
must be completed.". - Prefix for generic mandatory field incomplete message if the field has not been correctly labelled: "This field ".
- Error message concatenator:
%1$s
and%2$s
- Error message when a multi selection component has more than the allowed maximum number of selections: "
%1$s
must have no more than%2$s
options selected.". - Error message when a multi selection component has fewer than the required minimum number of selections: "
%1$s
must have at least%2$s
options 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.