Error: Enter an email address in the correct format, like name@example.com
"},
{"name": "lengths go on the input as minLength and maxLength", "args": [{"id": "code", "label": "Reference", "rules": {"label": "Reference", "kind": "text", "required": false, "minLength": 6, "maxLength": 10, "pattern": null, "patternMessage": null, "min": null, "max": null}}], "expect": ""},
{"name": "too long with showError: the length message", "args": [{"id": "code", "label": "Reference", "showError": true, "value": "ABCDEFGHIJK", "rules": {"label": "Reference", "kind": "text", "required": false, "minLength": 6, "maxLength": 10, "pattern": null, "patternMessage": null, "min": null, "max": null}}], "expect": "
Error: Reference must be 10 characters or less
"},
{"name": "a pattern goes on the input; its own message when it does not match", "args": [{"id": "mobile", "label": "UK mobile number", "showError": true, "value": "0123", "rules": {"label": "UK mobile number", "kind": "text", "required": false, "minLength": null, "maxLength": null, "pattern": "07[0-9]{9}", "patternMessage": "Enter a UK mobile number, like 07700900982", "min": null, "max": null}}], "expect": "
Error: Enter a UK mobile number, like 07700900982
"},
{"name": "a whole number: numeric keyboard, below min with showError", "args": [{"id": "children", "label": "How many children do you have?", "showError": true, "value": "-1", "rules": {"label": "Number of children", "kind": "integer", "required": true, "minLength": null, "maxLength": null, "pattern": null, "patternMessage": null, "min": "0", "max": "20"}}], "expect": "
Error: Number of children must be between 0 and 20
"},
{"name": "a decimal: decimal keyboard, not a number with showError", "args": [{"id": "weight", "label": "Weight, in kilograms", "showError": true, "value": "12,5", "rules": {"label": "Weight", "kind": "number", "required": false, "minLength": null, "maxLength": null, "pattern": null, "patternMessage": null, "min": "0.5", "max": "500"}}], "expect": "
Error: Weight must be a number
"},
{"name": "a valid value with showError shows no error; the hint still describes it", "args": [{"id": "weight", "label": "Weight, in kilograms", "hint": "For example, 72.5", "showError": true, "defaultValue": "72.5", "rules": {"label": "Weight", "kind": "number", "required": false, "minLength": null, "maxLength": null, "pattern": null, "patternMessage": null, "min": "0.5", "max": "500"}}], "expect": "
For example, 72.5
"},
{"name": "an error passed in wins, described after the hint", "args": [{"id": "username", "label": "Username", "hint": "Letters and numbers only", "error": "That username is taken", "value": "charles", "rules": {"label": "Username", "kind": "text", "required": true, "minLength": null, "maxLength": null, "pattern": "[A-Za-z0-9]+", "patternMessage": null, "min": null, "max": null}}], "expect": "