The placeholder provides contextual clues of what value users should enter in a control. A placeholder text is displayed when the TextBox is neither selected nor anything entered in it. You can add a placeholder text to the TextBox control using Placeholder property of the C1TextBox class. For example, in the following example, we added "Enter your password" as the placeholder text in the TextBox control to prompts the user to enter a password in it.
When you click within the control and enter text, you can notice that the Placeholder disappears. In the following code, the Placeholder property is used to add a placeholder text in the TextBox control. In addition, the Type property is used to define the type of text to be entered in the textbox and MaxLength property is used to limit the maximum number of characters allowed in the textbox.
Index.razor |
Copy Code
|
---|---|
<!--password type text box--> <C1TextBox Placeholder="Enter your password" Type="C1.Blazor.Core.C1HtmlInputType.Password" MaxLength="16"></C1TextBox> |