Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(input validation): fix examples for MaskedTextbox and Slider #1624

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions common-features/input-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,29 +531,35 @@ You may want to set the [`IncludeLiterals`]({%slug maskedtextbox-mask-prompt%}#i
<ValidationSummary />

<p>
<TelerikMaskedTextBox Mask="0000-0000-0000-0000"
IncludeLiterals="true"
Label="Credit Card:"
@bind-Value="@Payment.CreditCard">
</TelerikMaskedTextBox>
<TelerikFloatingLabel Text="Credit Card:">
<TelerikMaskedTextBox MaskOnFocus="true"
Mask="0000-0000-0000-0000"
IncludeLiterals="true"
@bind-Value="@Payment.CreditCard">
</TelerikMaskedTextBox>
</TelerikFloatingLabel>
<ValidationMessage For="@(() => Payment.CreditCard)" />
</p>

<p>
<TelerikMaskedTextBox Mask="+1-000-000-0000"
Label="Phone:"
@bind-Value="@Payment.PhoneNumber"
PromptPlaceholder="null">
</TelerikMaskedTextBox>
<TelerikFloatingLabel Text="Phone:">
<TelerikMaskedTextBox MaskOnFocus="true"
Mask="+1-000-000-0000"
@bind-Value="@Payment.PhoneNumber"
PromptPlaceholder="null">
</TelerikMaskedTextBox>
</TelerikFloatingLabel>
<ValidationMessage For="@(() => Payment.PhoneNumber)" />
</p>

<p>
<TelerikMaskedTextBox Mask="00000-9999"
Label="ZIP:"
@bind-Value="@Payment.Zip"
PromptPlaceholder="null">
</TelerikMaskedTextBox>
<TelerikFloatingLabel Text="ZIP:">
<TelerikMaskedTextBox MaskOnFocus="true"
Mask="00000-9999"
@bind-Value="@Payment.Zip"
PromptPlaceholder="null">
</TelerikMaskedTextBox>
</TelerikFloatingLabel>
<ValidationMessage For="@(() => Payment.Zip)" />
</p>

Expand Down Expand Up @@ -735,6 +741,12 @@ The sliders are, effectively, numeric inputs in terms of behavior and what data
<TelerikButton ButtonType="@ButtonType.Submit">Submit</TelerikButton>
</EditForm>

<style>
.validation-message {
margin-top: 1em;
}
</style>

@code{
MyModel TheModel { get; set; } = new MyModel();

Expand Down
Loading