Microsoft.Compute.UserNameTextBox UI element
A text box control with built-in validation for Windows and Linux user names.
UI sample
Schema
{
"name": "element1",
"type": "Microsoft.Compute.UserNameTextBox",
"label": "User name",
"defaultValue": "",
"toolTip": "",
"constraints": {
"required": true,
"regex": "^[a-z0-9A-Z]{1,30}$",
"validationMessage": "Only alphanumeric characters are allowed, and the value must be 1-30 characters long."
},
"osPlatform": "Windows",
"visible": true
}
Sample output
"Example name"
Remarks
- If
constraints.required
is set to true, then the text box must have a value to validate successfully. The default value is true. osPlatform
must be specified, and can be either Windows or Linux.constraints.regex
is a JavaScript regular expression pattern. If specified, then the text box's value must match the pattern to validate successfully. The default value is null.constraints.validationMessage
is a string to display when the text box's value fails the validation specified byconstraints.regex
. If not specified, then the text box's built-in validation messages are used. The default value is null.- This element has built-in validation that is based on the value specified for
osPlatform
. The built-in validation can be used along with a custom regular expression. If a value forconstraints.regex
is specified, then both the built-in and custom validations are triggered.
Next steps
- For an introduction to creating UI definitions, see Getting started with CreateUiDefinition.
- For a description of common properties in UI elements, see CreateUiDefinition elements.
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για