Training
Module
De werking van formulieren en validatie in Blazor-web-apps verbeteren - Training
Meer informatie over het gebruik van DOM-gebeurtenissen, formulieren en validatie in een Blazor-app
Deze browser wordt niet meer ondersteund.
Upgrade naar Microsoft Edge om te profiteren van de nieuwste functies, beveiligingsupdates en technische ondersteuning.
In versions 1.3 and later of the schema, AdaptiveCards supports client side input validation of Input types.
The following properties are supported for validation in AdaptiveCards:
Input | Properties |
---|---|
Input.ChoiceSet |
isRequired |
Input.Date |
isRequired min max |
Input.Number |
isRequired min max |
Input.Text |
isRequired regex maxLength |
Input.Time |
isRequired min max |
Input.Toggle |
isRequired |
An errorMessage
property is available on all input types to specify what error a user should be shown if they enter an invalid value.
Notitie
Min and max properties (including maxLength) on some platforms may be enforced directly by the control. For example, a min property on Input.Date may be enforced by not allowing users to select a date before the minimum in a date picker. In that case, the error message may not be shown.
Another property added in schema version 1.3 for all input elements is the label
string property. Using the label
property is the recommended way of tagging inputs in an Adaptive Card, vis-a-vis the placeholder
property. It is a simple and concise way of labelling inputs for card authors and has the following benefits:
HostConfig
and by default is rendered as an asterisk *
.label
property, we can ensure that both visual elements are rendered next to each other which helps users who need screen magnifiers.Inputs will be validated when the user clicks on an Action.Submit action in the card. Those inputs which will be validated and submitted for a given Action.Submit action are:
If those inputs pass validation, the values in their fields will be passed back to the client. If they do not pass validation, the error messages for the invalid inputs will be shown, and the submit will not be sent.
Notitie
Inputs will not be validated or submitted if they are on a card that is a child or sibling card of the card containing the Action.Submit. This includes cards from Action.ShowCards in ActionSets in the body of that card. This is a change in behavior from renderer versions prior to 2.0, and applies to cards of all schema versions, regardless of whether input validation properties are used.
It is not recommended to create inputs with validation properties that may not always be visible due to interaction with Action.ToggleVisibility. Error messages and visual indications that the input is invalid will not be shown if the input is not currently visible, which may cause confusion for users as to why their submit is blocked.
Behavior of input validation for hosts using popup show cards using the "actions":"showCard":"actionMode":"popup"
value in their host config is not well defined. Popup show cards may be deprecated in a future release.
Training
Module
De werking van formulieren en validatie in Blazor-web-apps verbeteren - Training
Meer informatie over het gebruik van DOM-gebeurtenissen, formulieren en validatie in een Blazor-app