diff --git a/src/base/registrations/Index.svelte b/src/base/registrations/Index.svelte index af0f1feb8..f37df890c 100644 --- a/src/base/registrations/Index.svelte +++ b/src/base/registrations/Index.svelte @@ -11,7 +11,25 @@ function register() { navigate(`/registrations/${label}/form`); } + + function validate(input: string): string[] { + const errors: string[] = []; + + if (input && input.includes(".")) { + errors.push("Please do not use dots as separators."); + } + if (input && input.length < 2) { + errors.push("Please enter a minimum of 2 characters."); + } + if (input && input.length > 128) { + errors.push("Please enter a maximum of 128 characters."); + } + + return errors; + } + $: label = input.trim(); + $: errors = validate(label);