@@ -72,12 +72,17 @@ Add text content to the `<validation-output>` element to display server-side val
7272``` html
7373<input type =" email" id =" email" value =" known@email" />
7474<validation-output for =" email" >
75- Email <b >known@email</b > already registered
75+ Invalid credentials. Please try again.
76+ </validation-output >
77+
78+ <input type =" text" id =" persistent" value =" rejected-value" />
79+ <validation-output for =" persistent" persistent >
80+ This error will be show again if the value is changed back to the rejected value
7681</validation-output >
7782```
7883
7984When the user modifies the input field, the server-side message is hidden.
80- If the user changes the value back to the original , the message will be shown again.
85+ If the ` persistent ` attribute is set and the user changes the value back to the rejected value , the message will be shown again.
8186
8287** Note:** When displaying server-side validation errors, the input element won't have the ` :user-invalid ` pseudo-class applied.
8388To style server-validated inputs, you can use the ` data-server-invalid="true" ` attribute selector instead.
@@ -108,7 +113,8 @@ validation-output:state(has-error) {
108113
109114### Attributes
110115
111- | Attribute | Required | Description |
112- | ------------| ----------| ----------------------------------------------------------|
113- | ` for ` | Yes | ID of the input element to validate |
114- | ` template ` | No | ID of the template containing custom validation messages |
116+ | Attribute | Required | Description |
117+ | --------------| ----------| -----------------------------------------------------------------------------------|
118+ | ` for ` | Yes | ID of the input element to validate |
119+ | ` template ` | No | ID of the template containing custom validation messages |
120+ | ` persistent ` | No | Show the server validation error again if the value reverts to the rejected value |
0 commit comments