Blazor | ComponentOne
Controls / Input Controls / Masked Text Box / Placeholder
In This Topic
    Placeholder
    In This Topic

    The placeholder provides contextual clues of what value users should enter in a control. MaskedTextBox lets you display a placeholder text in the MaskedTextBox control when nothing is selected or entered in it. You can add a placeholder text to the MaskedtextBox control using Placeholder property of the C1MaskedTextBox class. For example, in the following example, we added "Enter Phone Number" as a placeholder text in the MaskedtextBox control to prompts the user to enter a phone number in it.

     

    When you click within the control and enter text, you can notice that the Placeholder disappears.

    The following code shows the usage of the Placeholder property to add a placeholder text in the MaskedtextBox control:

    Index.razor
    Copy Code
    <C1MaskedTextBox Placeholder="Enter Phone number"></C1MaskedTextBox>