Skip to content

Commit

Permalink
sveltekit: novalidate on form
Browse files Browse the repository at this point in the history
  • Loading branch information
while1618 committed Nov 11, 2024
1 parent 415c1ae commit 1e7b0be
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-8">
<h1 class="text-center text-3xl font-bold">{m.auth_forgotPassword()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/forgotPassword" use:enhance>
<form
class="flex flex-col gap-4"
method="POST"
action="?/forgotPassword"
use:enhance
novalidate
>
<FormControl {superform} field="email" type="email" label={m.auth_email()} />
<p class="label-text text-error">{$errors?._errors}</p>
<button class="btn btn-primary">{m.general_send()}</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-8">
<h1 class="text-center text-3xl font-bold">{m.auth_resetPassword()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/resetPassword" use:enhance>
<form
class="flex flex-col gap-4"
method="POST"
action="?/resetPassword"
use:enhance
novalidate
>
<FormControl {superform} field="password" type="password" label={m.auth_password()} />
<FormControl
{superform}
Expand Down
2 changes: 1 addition & 1 deletion frontend/svelte-kit/src/routes/auth/sign-in/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-8">
<h1 class="text-center text-3xl font-bold">{m.auth_signIn()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/signIn" use:enhance>
<form class="flex flex-col gap-4" method="POST" action="?/signIn" use:enhance novalidate>
<FormControl
{superform}
field="usernameOrEmail"
Expand Down
2 changes: 1 addition & 1 deletion frontend/svelte-kit/src/routes/auth/sign-up/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-8">
<h1 class="text-center text-3xl font-bold">{m.auth_signUp()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/signUp" use:enhance>
<form class="flex flex-col gap-4" method="POST" action="?/signUp" use:enhance novalidate>
<FormControl {superform} field="username" type="text" label={m.auth_username()} />
<FormControl {superform} field="email" type="email" label={m.auth_email()} />
<FormControl {superform} field="password" type="password" label={m.auth_password()} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-2">
<h1 class="mb-6 text-center text-3xl font-bold">{m.profile()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/updateProfile" use:enhance>
<form class="flex flex-col gap-4" method="POST" action="?/updateProfile" use:enhance novalidate>
<FormControl {superform} field="username" type="text" label={m.profile_username()} />
<FormControl {superform} field="email" type="email" label={m.profile_email()} />
<p class="label-text text-error">{$errors?._errors}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@
<div class="card mx-auto w-full max-w-xl bg-base-200 p-8 shadow-xl">
<div class="flex flex-col gap-2">
<h1 class="mb-6 text-center text-3xl font-bold">{m.profile_security()}</h1>
<form class="flex flex-col gap-4" method="POST" action="?/changePassword" use:enhance>
<form
class="flex flex-col gap-4"
method="POST"
action="?/changePassword"
use:enhance
novalidate
>
<FormControl
{superform}
field="currentPassword"
Expand Down

0 comments on commit 1e7b0be

Please sign in to comment.