|
1 | 1 | ---
|
2 | 2 | title: TextBox UI element
|
3 |
| -description: Describes the Microsoft.Common.TextBox UI element for Azure portal. Use for adding unformatted text. |
| 3 | +description: Describes the Microsoft.Common.TextBox UI element for Azure portal that's used for adding unformatted text. |
4 | 4 | author: davidsmatlak
|
5 |
| - |
6 |
| -ms.topic: conceptual |
7 |
| -ms.date: 03/03/2021 |
8 | 5 | ms.author: davidsmatlak
|
9 |
| - |
| 6 | +ms.topic: conceptual |
| 7 | +ms.date: 08/23/2022 |
10 | 8 | ---
|
11 | 9 |
|
12 | 10 | # Microsoft.Common.TextBox UI element
|
13 | 11 |
|
14 |
| -A user-interface (UI) element that can be used to add unformatted text. The `Microsoft.Common.TextBox` element is a single-line input field, but supports multi-line input with the `multiLine` property. |
| 12 | +The `TextBox` user-interface (UI) element can be used to add unformatted text. The element is a single-line input field, but supports multi-line input with the `multiLine` property. |
15 | 13 |
|
16 | 14 | ## UI sample
|
17 | 15 |
|
18 | 16 | The `TextBox` element uses a single-line or multi-line text box.
|
19 | 17 |
|
20 |
| -:::image type="content" source="media/managed-application-elements/microsoft-common-textbox.png" alt-text="Microsoft.Common.TextBox element single-line text box."::: |
| 18 | +Example of single-line text box. |
21 | 19 |
|
22 |
| -:::image type="content" source="media/managed-application-elements/microsoft-common-textbox-multi-line.png" alt-text="Microsoft.Common.TextBox element multi-line text box."::: |
| 20 | +:::image type="content" source="media/managed-application-elements/microsoft-common-textbox.png" alt-text="Screenshot of the Microsoft.Common.TextBox element's single-line text box."::: |
| 21 | + |
| 22 | +Example of multi-line text box. |
| 23 | + |
| 24 | +:::image type="content" source="media/managed-application-elements/microsoft-common-textbox-multi-line.png" alt-text="Screenshot of the Microsoft.Common.TextBox element's multi-line text box."::: |
23 | 25 |
|
24 | 26 | ## Schema
|
25 | 27 |
|
@@ -75,34 +77,47 @@ The examples show how to use a single-line text box and a multi-line text box.
|
75 | 77 |
|
76 | 78 | The following example uses a text box with the [Microsoft.Solutions.ArmApiControl](microsoft-solutions-armapicontrol.md) control to check the availability of a resource name.
|
77 | 79 |
|
| 80 | +In this example, when you enter a storage account name and exit the text box, the control checks if the name is valid and if it's available. If the name is invalid or already exists, an error message is displayed. A storage account name that's valid and available is shown in the output. |
| 81 | + |
78 | 82 | ```json
|
79 |
| -"basics": [ |
80 |
| - { |
| 83 | +{ |
| 84 | + "$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#", |
| 85 | + "handler": "Microsoft.Azure.CreateUIDef", |
| 86 | + "version": "0.1.2-preview", |
| 87 | + "parameters": { |
| 88 | + "basics": [ |
| 89 | + { |
81 | 90 | "name": "nameApi",
|
82 | 91 | "type": "Microsoft.Solutions.ArmApiControl",
|
83 | 92 | "request": {
|
84 |
| - "method": "POST", |
85 |
| - "path": "[concat(subscription().id, '/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-04-01')]", |
86 |
| - "body": { |
87 |
| - "name": "[basics('txtStorageName')]", |
88 |
| - "type": "Microsoft.Storage/storageAccounts" |
89 |
| - } |
| 93 | + "method": "POST", |
| 94 | + "path": "[concat(subscription().id, '/providers/Microsoft.Storage/checkNameAvailability?api-version=2021-09-01')]", |
| 95 | + "body": { |
| 96 | + "name": "[basics('txtStorageName')]", |
| 97 | + "type": "Microsoft.Storage/storageAccounts" |
| 98 | + } |
90 | 99 | }
|
91 |
| - }, |
92 |
| - { |
| 100 | + }, |
| 101 | + { |
93 | 102 | "name": "txtStorageName",
|
94 | 103 | "type": "Microsoft.Common.TextBox",
|
95 | 104 | "label": "Storage account name",
|
96 | 105 | "constraints": {
|
97 |
| - "validations": [ |
98 |
| - { |
99 |
| - "isValid": "[basics('nameApi').nameAvailable]", |
100 |
| - "message": "[basics('nameApi').message]" |
101 |
| - } |
102 |
| - ] |
| 106 | + "validations": [ |
| 107 | + { |
| 108 | + "isValid": "[basics('nameApi').nameAvailable]", |
| 109 | + "message": "[basics('nameApi').message]" |
| 110 | + } |
| 111 | + ] |
103 | 112 | }
|
| 113 | + } |
| 114 | + ], |
| 115 | + "steps": [], |
| 116 | + "outputs": { |
| 117 | + "textBox": "[basics('txtStorageName')]" |
104 | 118 | }
|
105 |
| -] |
| 119 | + } |
| 120 | +} |
106 | 121 | ```
|
107 | 122 |
|
108 | 123 | ### Multi-line
|
@@ -148,3 +163,4 @@ This example uses the `multiLine` property to create a multi-line text box with
|
148 | 163 |
|
149 | 164 | - For an introduction to creating UI definitions, see [CreateUiDefinition.json for Azure managed application's create experience](create-uidefinition-overview.md).
|
150 | 165 | - For a description of common properties in UI elements, see [CreateUiDefinition elements](create-uidefinition-elements.md).
|
| 166 | +- To learn more about functions, see [CreateUiDefinition functions](create-uidefinition-functions.md). |
0 commit comments