@page "/popup"
Popup
@using System.Text.RegularExpressions
@using System.ComponentModel.DataAnnotations
button
Personal
Professional
Register
Validate
Reset
Reset Validation
@($"Errors ({errors.Length})")
@foreach (var error in errors)
{
@error
}
@code {
bool success;
string[] errors = { };
MudTextField pwField1;
MudForm form;
private IEnumerable PasswordStrength(string pw)
{
if (string.IsNullOrWhiteSpace(pw))
{
yield return "Password is required!";
yield break;
}
if (pw.Length < 8)
yield return "Password must be at least of length 8";
if (!Regex.IsMatch(pw, @"[A-Z]"))
yield return "Password must contain at least one capital letter";
if (!Regex.IsMatch(pw, @"[a-z]"))
yield return "Password must contain at least one lowercase letter";
if (!Regex.IsMatch(pw, @"[0-9]"))
yield return "Password must contain at least one digit";
}
private string PasswordMatch(string arg)
{
if (pwField1.Value != arg)
return "Passwords don't match";
return null;
}
private void function()
{
}
}