Skip to content

Password mask #55

@jasonlaw

Description

@jasonlaw

May I know how to add the password mask? I am using MudBlazor.

I have tried many ways but the password still rendered as text instead of password input type.

        formConfiguration = FormBuilder<LoginFormModel>
                               .Create()
                                    .AddEmailField(x => x.Email, label: "Email", placeholder: "Enter your email")
                                    .AddField(x => x.Password, field =>
                                    {
                                        field
                                        .WithLabel("Password")
                                        .Required("Password is required")
                                        .WithMinLength(8, $"Must be at least 8 characters")
                                        .WithPlaceholder("Enter your password")
                                        .WithInputType("password")
                                        .WithAttribute("InputType", "password")
                                        .WithAttribute("Mask", "*");
                                    })
                               .Build();

Besides, may I also know how to add a toggle icon inside the password textbox to show/hide the password?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions