# Blazor TextBox, Numeric TextBox and TextArea

URL: https://flexcoreui.com/demo/text-inputs  
Section: Components  
Controls: TextBoxControl, NumericTextBoxControl, TextAreaControl, MaskedTextBoxControl, PasswordControl  
Keywords: textbox, text input, numeric textbox, number input, textarea, masked textbox, input mask, password box

Blazor text inputs: text, numbers and notes, a masked box for phone numbers and a password box, bound on change or per keystroke.

## Documentation

### Text box

| Name | Type | Default | Description |
|---|---|---|---|
| Value | string? | null | The text. Bind with @bind-Value. |
| ValueExpression | Expression<Func<string?>>? | null | Set by @bind-Value. Server-backed edits then notify a surrounding EditForm's EditContext. In the plain case (no UpdateOnInput, OnKeyDown, InputValueChanged, focus or selection options, classic menu, clear button or ClientBuffered) the control renders Blazor's own InputText, or InputTextArea when multi-line. |
| Placeholder | string? | null | Hint shown while the box is empty. An explicit placeholder attribute wins. |
| CssClass | string? | null | Class on the input, merged with any class attribute. Without one the input has no styling of its own; this page adds text-field. |
| Width | string? | null | CSS width written as an inline style, such as 250px or 100%. On a password box it sizes the wrapper and the input fills it. |
| ShowClearButton | bool | false | Adds a × button inside a single-line box whose type is text. It shows while the box has focus and holds text; clicking it empties the box and raises ValueChanged with the empty text. |
| Enabled | bool | true | False renders disabled. There is no ReadOnly parameter; a readonly attribute passes through to the input. |
| MaxLength | int? | null | Writes maxlength. A client-buffered commit is also cut to this length. |
| InputType | string | "text" | The input's type: email, tel, password and so on. Ignored when Multiline; an explicit type attribute wins except for a password box. |
| Multiline | bool | false | Renders a <textarea> instead of an input. |
| Rows | int? | null | Writes the rows attribute: the visible lines of a multi-line box. |
| UpdateOnInput | bool | false | Raise ValueChanged on every keystroke instead of when the field changes. |
| TypingBehavior | TextBoxTypingBehavior | TextBoxTypingBehavior.ServerBacked | ClientBuffered keeps keystrokes in the browser and sends the whole value when the box loses focus; see the values table. |
| Uncontrolled | bool | true | The browser owns the text, so a parent re-render never writes older text back over what is being typed. False gives the controlled input whose value follows Value on every render. |
| ReseedOnOutsideChange | bool | true | When the parent sets a different Value from code, a browser-owned box shows it. Grid editors that push values through their own channel set this false. |
| AutoFocus | bool | false | Focuses the box after the first render and writes autofocus. |
| SelectOnFocus | bool | false | With AutoFocus, that first focus selects the text. On a later focus the control asks its script to select, and the script skips this whenever the text differs from the element's value attribute, which Blazor does not write, so a box holding text is not selected. |
| ReplaceOnFirstInput | bool | false | After the box gains focus, the first character typed replaces the whole text and the first Backspace or Delete clears it. A click inside the focused box cancels this. |
| SelectAllOnDoubleClick | bool | false | Double-click asks the script to select the whole text; the same value-attribute check as SelectOnFocus skips it for a box holding text. |
| UseClassicContextMenu | bool | false | Replaces the browser's right-click menu with the control's own Windows-style menu. |
| ContextMenuItems | TextContextMenuItems | TextContextMenuItems.Legacy | The items the classic menu shows; see the values table. |
| KeepNativeTab | bool | false | For ClientBuffered with an OnKeyDown handler: Tab commits and is reported once, but the browser still moves focus. Grid cell editors leave it false. |
| TypingKeysStayLocal | bool | false | Keydown events for printable keys, Backspace and Delete are not sent to the server; the text itself still is. Not used with ClientBuffered. For browser-owned editors whose host ignores typing keys, such as the grid's cell editor. |
| HtmlAttributes | Dictionary<string, object>? | null | More attributes for the input, merged after the unmatched ones. |
| ElementReferenceCaptured | Action<ElementReference>? | null | Called after each render with the input's ElementReference. |
| AdditionalAttributes | IDictionary<string, object>? | null | Captures unmatched attributes (id, aria-label, readonly…) and writes them on the input. |

### Password

| Name | Type | Default | Description |
|---|---|---|---|
| ShowPasswordToggle | bool | true | Shows the eye button that reveals and hides the password. |
| RevealLastTypedCharacter | bool | true | Briefly draws the character just typed over the masked box. Pasted, autofilled and programmatic text stays masked. |
| PasswordRevealDurationMs | int | 1000 | How long that character shows. 0 turns it off; values above 2000 are capped at 2000. |
| ExistingPasswordViewable | bool | true | False starts the box blank and never renders the supplied Value; a blank commit before any typing is ignored. Keep the saved value on the server. |
| PasswordRevealUnavailableReason | string? | null | Keeps the eye visible but disabled, with this text as its label and tooltip, for example when only a hash is stored. |

### Text box events

| Name | Type | Description |
|---|---|---|
| ValueChanged | string? | When the field changes (Tab out, click away, Enter), or on every keystroke with UpdateOnInput. With ClientBuffered, when the box loses focus. Also after a classic-menu command that changed the text. |
| InputValueChanged | string? | A plain Action<string?> called with the text on every input event, with or without UpdateOnInput (with ClientBuffered, on each commit). It does not re-render the parent. |
| OnKeyDown | KeyboardEventArgs | Key presses in the box; while it is unset, the box sends no keydown events to the server. With ClientBuffered it receives the commit keys (Enter, Tab, Up, Down, the page keys) after the value has been sent, and Escape without sending it; it never sees the typing keys. |
| OnBlur |  | When the box loses focus, after a client-buffered draft has been sent. |
| OnPasteTruncated | (int PastedLength, int MaxLength) | A paste was cut short by MaxLength. The browser trims before any input event, so this is the only notice. |

### Text box methods

| Name | Type | Description |
|---|---|---|
| FocusAsync(bool preventScroll = true) | ValueTask | Focuses the input. |
| FlushClientBufferedValueAsync() / FlushClientBufferedValueAsync(bool requireCurrentValue) | Task | With ClientBuffered, reads the browser's text and raises ValueChanged now, for a Save button that should not wait for blur. With requireCurrentValue a failed read throws instead of leaving the older value. |

### Numeric

| Name | Type | Default | Description |
|---|---|---|---|
| Value | TValue? | default | The number. Bind with @bind-Value and set TValue to int, decimal, double, float or a nullable form of one. |
| Format | string? | null | A .NET format for the number shown, applied with the invariant culture. Every C and N in it becomes F, so C2 shows 3200.00 without a symbol. A custom format with group separators gives text a number input cannot display. |
| Placeholder | string? | null | Hint shown while the box is empty. |
| Width | string? | null | CSS width written as an inline style. |
| CssClass | string? | null | Added after fx-numeric. |
| Enabled | bool | true | False renders disabled (grayed by the stylesheet). |
| Min / Max | decimal? | null | Bounds. A committed value outside them is replaced by the bound. The box shows the bound, except when the value already was that bound: then the typed text stays on screen. Also written as the input's min and max. |
| Step | decimal | 1 | The input's step, which the browser uses for ArrowUp and ArrowDown. The default 1 writes step="any"; any other value is written as given and makes inputmode decimal. |
| MaxLength | int? | null | Writes maxlength and switches the input to type="text", because number inputs ignore maxlength. |
| TabIndex | int? | null | The input's tabindex. |
| ClearOnCommit | bool | false | After each accepted commit the box clears and ValueChanged receives the default value (null for a nullable type). After an Enter commit focus stays in the box. |

### Numeric events

| Name | Type | Description |
|---|---|---|
| ValueChanged | TValue? | On commit (Enter, Tab, a click away), after parsing and clamping; never per keystroke. Blank or unreadable text commits as 0, or null for a nullable type when blank, before Min and Max apply. |
| ValueChange | NumericChangeEventArgs<TValue> | Right after ValueChanged, with the same value. Setting Cancel keeps the typed text, marks the input aria-invalid, returns focus to it and skips ClearOnCommit. It does not undo the ValueChanged call, so a page that rejects values listens to this one only, as the budget box does. |

### Numeric args

| Name | Type | Default | Description |
|---|---|---|---|
| Value | TValue? | default | The parsed, clamped value. |
| Cancel | bool | false | Set true to reject the commit; see ValueChange. |

### Text area

| Name | Type | Default | Description |
|---|---|---|---|
| Value | string? | null | The text. Bind with @bind-Value. |
| ValueExpression | Expression<Func<string?>>? | null | Accepted so @bind-Value compiles; otherwise unused, so there is no EditForm field tracking. |
| Placeholder | string? | null | Hint shown while the box is empty. |
| CssClass | string? | null | Added to the textarea; with the classic scroll bar it goes on the host <div> instead. |
| Enabled | bool | true | False renders disabled: gray background, no resizing. There is no ReadOnly parameter. |
| MaxLength | int? | null | Writes maxlength. InsertTextAsync refuses text that would pass it, and a client-buffered commit is cut to it. |
| Rows | int? | null | Visible lines; 4 when null. |
| SpellCheck | bool? | null | Writes spellcheck="true" or "false"; null leaves the browser's default. |
| ScrollBars | TextAreaScrollBars | TextAreaScrollBars.Auto | Native scrolling per axis; Horizontal and Both also turn wrapping off. Vertical and Both switch to the classic scroll bar unless ClassicScrollBar is false. |
| ClassicScrollBar | bool? | null | A drawn 16px vertical scroll bar with arrow buttons, track and thumb beside the text. Null follows ScrollBars. |
| UpdateOnInput | bool | false | Raise ValueChanged on every keystroke instead of when the box loses focus. |
| Uncontrolled | bool | false | The textarea renders its first value once and later renders never rewrite it. Give it a new @key to load different text. |
| TypingBehavior | TextBoxTypingBehavior | TextBoxTypingBehavior.ServerBacked | ClientBuffered keeps keystrokes in the browser and sends the whole text once, when the box loses focus. Enter stays a new line. |
| TabSpaces | int | 0 | Above 0, Tab inserts this many spaces at the caret instead of leaving the box. Shift+Tab still leaves. |
| ReplaceOnFirstInput | bool | false | After the box gains focus, the first character typed replaces the whole text and the first Backspace or Delete clears it. |
| SelectAllOnDoubleClick | bool | false | Double-click asks the script to select the whole text. The script skips this whenever the text differs from the element's value attribute, and a textarea never has one, so a box holding text is not selected. |
| UseClassicContextMenu | bool | false | Replaces the browser's right-click menu, and its spelling suggestions, with the control's own menu. |
| ContextMenuItems | TextContextMenuItems | TextContextMenuItems.Legacy | The items the classic menu shows. |

### Text area events

| Name | Type | Description |
|---|---|---|
| ValueChanged | string? | When the box loses focus after an edit, or on every keystroke with UpdateOnInput; with ClientBuffered, on blur. Also after InsertTextAsync, FlushClientBufferedValueAsync and a classic-menu command that changed the text. |

### Text area methods

| Name | Type | Description |
|---|---|---|
| InsertTextAsync(string text) | Task<bool> | Inserts the whole text at the caret, or over the selection, and focuses the box. Works after focus has moved to a button, because the textarea keeps its selection. Returns false and inserts nothing when the result would pass MaxLength, the box is disabled or the text is empty; throws InvalidOperationException when the control's script cannot load. |
| FocusAsync() | ValueTask | Focuses the textarea without moving its caret or selection. |
| FlushClientBufferedValueAsync() | Task | With Uncontrolled or ClientBuffered, reads the browser's text and raises ValueChanged now, without waiting for blur. |

### Typing

| Name | Description |
|---|---|
| ServerBacked | The default: edits travel through Blazor's own input and change events. |
| ClientBuffered | Input and change events are stopped in the browser and the whole value is sent in one call when the box loses focus. A TextBoxControl with an OnKeyDown handler also commits on Enter, Tab, Up, Down and the page keys, as a grid cell editor needs. |

### Scroll bars

| Name | Description |
|---|---|
| Auto | The default: a scroll bar appears when the text overflows. |
| None | No scroll bars; overflow is hidden. |
| Horizontal | Horizontal scrolling only; wrapping is off. |
| Vertical | A vertical scroll bar always shown; the classic one unless ClassicScrollBar is false. |
| Both | Both scroll bars always shown and wrapping off; the vertical one is classic unless ClassicScrollBar is false. |

### Menu items

| Name | Description |
|---|---|
| None | No items. |
| Undo · Cut · Copy · Paste · Delete · SelectAll | The editing commands. Cut, Copy and Delete need a selection; Select All is off when the box is empty or fully selected; Undo, Cut, Paste and Delete are off when the control is disabled. Paste reads the clipboard through the browser, which may ask for permission first. |
| ReadingOrder | Switches the box between left-to-right and right-to-left; shown checked while right-to-left. |
| UnicodeOptions | Two Unicode control-character items kept for the Windows look; always disabled. |
| Ime | An "Open IME" item whose command does nothing. |
| Reconversion | A "Reconversion" item; always disabled. |
| Editing | Undo, Cut, Copy, Paste, Delete and SelectAll. The notes example uses this. |
| Legacy · All | Every item above. Legacy is the default. |

### Password ctl

| Name | Type | Default | Description |
|---|---|---|---|
| Behavior | PasswordBehavior | Standard | Standard binds Value. Replacement binds Replacement instead, for changing a stored password without loading it: the box starts blank and Value is ignored. |
| Value | string? | null | Standard mode: the password, two-way with @bind-Value. Do not load a stored secret just to bind it. |
| Replacement | string? | null | Replacement mode: the new password typed so far, two-way with @bind-Replacement. Null means unchanged, an empty string a cleared box. |
| EditSessionKey | object? | null | Change it when another record loads, to drop a draft the browser still holds and reset the eye. |
| RevealLastTypedCharacter | bool | false | Briefly shows the character just typed. Off by default here, unlike on TextBoxControl. |
| (shared with TextBoxControl) |  |  | ShowPasswordToggle, PasswordRevealDurationMs, MaxLength, Placeholder, Width, CssClass, Enabled, UpdateOnInput, Uncontrolled, TypingBehavior, KeepNativeTab, AutoFocus, SelectOnFocus, OnKeyDown, OnBlur and ElementReferenceCaptured go to the inner text box; see the tables above. Here UpdateOnInput and KeepNativeTab default to true. |
| (unmatched attributes) | IDictionary<string,object> |  | Passed to the input, except value and type. Without an autocomplete attribute it writes current-password, or new-password in Replacement mode. |

### Masked

| Name | Type | Default | Description |
|---|---|---|---|
| Value | string? | null | The committed text: formatted with the mask's literals, such as 206-555-0142, or only the typed characters when IncludeLiterals is false. Two-way with @bind-Value; a new value from the page resets the box and clears the error. |
| Mask | string | "000-000-0000" | The pattern; see Mask characters below. An empty mask, or one ending in \, throws. |
| IncludeLiterals | bool | true | True commits the formatted text; false commits only the typed characters, such as 2065550142. |
| PromptChar | char | '_' | Marks an optional position left empty in the committed text; typed, it leaves that position empty. |
| Required | bool | false | Makes an empty box an error, when the mask has a required position. When false, an empty box commits an empty string, but a partly filled one is still checked. |
| ReadOnly | bool | false | Disables the box and skips committing. |
| Placeholder | string? | null | Hint text in the empty box. |
| AriaLabel | string | "Masked value" | The input's aria-label. |
| ValueExpression | Expression<Func<string?>>? | null | Set by @bind-Value inside an EditForm: an error joins the form's validation messages, and a commit marks the field changed. |
| Enabled / Visible (base) | bool | true | Enabled false disables the box; Visible false hides it with display:none. |
| Id (base) | string? | null | Written as the input's id, so a <label for> can point at it. |
| CssClass / Style (base) | string? | null | On the fx-masked-textbox wrapper. |
| Title / Tag / Data / Parent (base) · unmatched attributes |  | null | Accepted but not rendered. |

### Masked events

| Name | Type | Description |
|---|---|---|
| ValueChanged | string? | After a commit the mask accepts: on leaving the box or Enter. Typing alone does not raise it. |
| OnChange | MaskResult | Right after ValueChanged, with the formatted text, the typed characters and whether every required position is filled. Not raised when the mask rejects the entry. |

### Masked methods

| Name | Type | Description |
|---|---|---|
| CommitAsync() | Task | Checks and commits what is in the box, as leaving it does; call it before saving. Ignored while disabled or read-only. |
| Error | string? | Read-only property: the current message, or null: "The value does not match the input mask." or "Complete the required mask positions." Cleared as soon as the user types. |

### Mask chars

| Name | Description |
|---|---|
| 0 / 9 | A required digit / an optional digit. |
| # | An optional digit, plus sign, minus sign or space. |
| L / ? | A required letter / an optional letter. |
| A / a | A required letter or digit / an optional one. |
| & / C | A required character / an optional one; anything but a control character. |
| > / < / \| | Upper-case, lower-case, or stop changing the case of the positions that follow. |
| \ | Makes the next character a literal, such as \0 for a fixed zero. |
| Any other character | A literal, such as - or (, written into the formatted text. Typed literals are accepted and skipped. |

### Mask result

| Name | Type | Description |
|---|---|---|
| Text | string | The formatted text, or the typed characters alone when literals are left out. |
| RawValue | string | The typed characters alone, after any case change. |
| Complete | bool | True when every required position is filled. |
| Error | string? | Null when the entry is accepted, else the message shown under the box. |

### Keys

| Name | Description |
|---|---|
| Enter (NumericTextBoxControl) | Commits the typed number: parse, clamp, ValueChanged, then ValueChange. |
| Tab, or a click away | Commits a NumericTextBoxControl, and raises the change-time ValueChanged of the text controls when UpdateOnInput is off. |
| Enter (single-line TextBoxControl, server-backed) | The browser's change event fires, so a changed value is reported without leaving the box. |
| ArrowUp / ArrowDown (NumericTextBoxControl) | The browser's own number-input stepping, while the input is type="number" (no MaxLength). With Step other than 1 it steps by that amount. |
| Tab (TextAreaControl with TabSpaces) | Inserts spaces at the caret. Shift+Tab still moves focus back. |
| Enter (MaskedTextBoxControl) | Commits the entry. When the mask rejects it inside a DialogControl with OnEnter, the dialog's default action does not run. |

## Examples

### Details

```razor
@using Fx.ControlKit

<div class="ti">
    <div class="details">
        <label class="field">
            <span class="field-label">Lead traveler</span>
            <TextBoxControl @bind-Value="_name" UpdateOnInput="true" ShowClearButton="true"
                            Placeholder="Full name as on the passport" MaxLength="40" CssClass="text-field" />
        </label>
        <label class="field">
            <span class="field-label">Email</span>
            <TextBoxControl @bind-Value="_email" InputType="email"
                            Placeholder="name@example.com" MaxLength="80" CssClass="text-field" />
        </label>
        <label class="field">
            <span class="field-label">Travelers (1 to 12)</span>
            <NumericTextBoxControl TValue="int" @bind-Value="_travelers" Min="1" Max="12" Width="90px" />
        </label>
        <label class="field">
            <span class="field-label">Budget in dollars, steps of 50</span>
            <NumericTextBoxControl TValue="decimal" Value="_budget" ValueChange="CheckBudget"
                                   Format="C2" Step="50" Min="0" Width="140px" />
        </label>
    </div>
    <div class="tag-preview" role="status">
        <span class="tag-name">@(string.IsNullOrWhiteSpace(_name) ? "NO NAME YET" : _name.ToUpperInvariant())</span>
        <span><strong>@Trip.Name</strong>, @Trip.Nights nights, @TravelerCount</span>
        <span>Confirmation goes to @(string.IsNullOrWhiteSpace(_email) ? "nobody yet" : _email)</span>
        <span>Budget @_budget.ToString("$#,##0") (@((_budget / _travelers).ToString("$#,##0")) a head)</span>
    </div>
    <p class="warn" role="status">@(_budgetNote ?? LowBudget)</p>
</div>
```

```csharp
// Traveler details
private static readonly TravelData.Package Trip = TravelData.Packages[2];
private string? _name = "Albus Door";
private string? _email;
private int _travelers = 2;
private decimal _budget = 3200m;
private string? _budgetNote;
private string TravelerCount => _travelers == 1 ? "1 traveler" : $"{_travelers} travelers";
private decimal Floor => 250m * _travelers;
private void CheckBudget(NumericTextBoxControl<decimal>.NumericChangeEventArgs<decimal> e)
{
    if (e.Value < Floor)
    {
        e.Cancel = true;
        _budgetNote = $"Budget not accepted: at least {Floor:$#,##0} for {TravelerCount}. The box keeps your figure until you change it.";
        return;
    }
    _budget = e.Value;
    _budgetNote = null;
}
// Raising Travelers can leave an accepted budget under the floor.
private string? LowBudget => _budget < Floor ? $"Raise the budget to at least {Floor:$#,##0} for {TravelerCount}." : null;
```

### Notes

```razor
@using Fx.ControlKit

<div class="ti">
    <div class="notes">
        <label class="field">
            <span class="field-label">Booking note for @Trip.Name</span>
            <Fx.ControlKit.TextAreaControl @ref="_noteBox" @bind-Value="_note" UpdateOnInput="true" MaxLength="NoteLimit" Rows="5"
                                           SpellCheck="true" Placeholder="Dietary needs, room requests, arrival times"
                                           UseClassicContextMenu="_classicMenu" ContextMenuItems="TextContextMenuItems.Editing" />
        </label>
        <div class="note-bar">
            <span class="count @(NoteLimit - NoteLength <= 20 ? "near" : null)">@NoteLength / @NoteLimit characters</span>
            @foreach (var phrase in Phrases)
            {
                <ButtonControl CssClass="btn-sm" OnClick="() => Insert(phrase)">@phrase</ButtonControl>
            }
            <SwitchControl @bind-Checked="_classicMenu" Label="Classic context menu" />
        </div>
        <p class="warn" role="status">@_noteStatus</p>
    </div>
</div>
```

```csharp
// Notes with a limit
private static readonly TravelData.Package Trip = TravelData.Packages[2];
private const int NoteLimit = 200;
private static readonly string[] Phrases = { "Airport transfer requested.", "Vegetarian meals.", "Late arrival, hold the room." };
private Fx.ControlKit.TextAreaControl? _noteBox;
private string? _note = "Arriving on the late flight on day one. ";
private bool _classicMenu;
private string? _noteStatus;
private int NoteLength => _note?.Length ?? 0;
private async Task Insert(string phrase)
{
    if (_noteBox is null) return;
    var inserted = await _noteBox.InsertTextAsync(phrase + " ");
    _noteStatus = inserted ? "Inserted at the caret." : $"Not inserted: the phrase would pass the {NoteLimit}-character limit.";
}
```

### Portal

```razor
@using Fx.ControlKit

<div class="ti">
    <div class="details">
        <label class="field">
            <span class="field-label">Mobile number</span>
            <MaskedTextBoxControl @ref="_mask" @bind-Value="_phone" Mask="000-000-0000" Required="true" Placeholder="206-555-0142" AriaLabel="Mobile number" OnChange="PhoneSet" />
        </label>
        <label class="field">
            <span class="field-label">Password</span>
            <PasswordControl @bind-Value="_password" RevealLastTypedCharacter="true" PasswordRevealDurationMs="800" MaxLength="40" Width="100%"
                             Placeholder="At least 8 characters" CssClass="text-field" aria-label="Password" />
        </label>
    </div>
    <ul class="rules">
        <li class="@(LongEnough ? "ok" : null)">8 characters or more</li>
        <li class="@(HasDigit ? "ok" : null)">a digit</li>
        <li class="@(HasUpper ? "ok" : null)">a capital letter</li>
    </ul>
    <div class="note-bar">
        <ButtonControl CssClass="btn-primary btn-sm" Disabled="@(!CanCreate)" OnClick="CreateAccount">Create account</ButtonControl>
        <span class="warn" role="status">@_portal</span>
    </div>
</div>
```

```csharp
// Traveler portal sign-up
private MaskedTextBoxControl? _mask;
private string? _phone, _password, _portal;
private bool _phoneOk;
// OnChange runs only for a number the mask accepts.
private void PhoneSet(MaskResult result)
{
    _phoneOk = result.Complete;
    _portal = null;
}
private bool LongEnough => (_password?.Length ?? 0) >= 8;
private bool HasDigit => _password?.Any(char.IsDigit) == true;
private bool HasUpper => _password?.Any(char.IsUpper) == true;
private bool CanCreate => _phoneOk && LongEnough && HasDigit && HasUpper;
// The number may have been changed to one the mask rejects since it was accepted: check it again.
private async Task CreateAccount()
{
    if (_mask is null) return;
    await _mask.CommitAsync();
    if (_mask.Error is not null)
    {
        _phoneOk = false;
        _portal = "Not created: enter all ten digits of the mobile number.";
        return;
    }
    _portal = $"Account created for Albus Door; codes go to {_phone}.";
}
```

