diff --git a/web/src/components/forms/blank-project-form.tsx b/web/src/components/forms/blank-project-form.tsx index 15afbea1..dd490375 100644 --- a/web/src/components/forms/blank-project-form.tsx +++ b/web/src/components/forms/blank-project-form.tsx @@ -50,7 +50,7 @@ const CombinedErrorMessage = (props: CombinedErrorMessageProps) => { } if (nameError || tagError) { - return

{msg}

; + return

{msg}

; } return null; @@ -147,9 +147,15 @@ sample_table: samples.csv // dont allow any whitespace {...register('project_name', { required: true, + required: { + value: true, + message: "empty", + }, pattern: { value: /^\S+$/, message: 'No spaces allowed.', + value: /^[a-zA-Z0-9_-]+$/, + message: "invalid", }, })} id="blank-project-name" @@ -159,10 +165,20 @@ sample_table: samples.csv /> : - + - -

{message}

} /> +