Disabled after submit
This commit is contained in:
@@ -37,6 +37,7 @@ $: errorSlugs = ((): {
|
||||
$: invalid = Object.values(errorSlugs).some(slug => slug !== null)
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (submitted) return
|
||||
attemptedSubmit = true
|
||||
|
||||
if (invalid) return
|
||||
@@ -73,6 +74,7 @@ const handleSubmit = () => {
|
||||
autocomplete="off"
|
||||
bind:value={form.message}
|
||||
class="md:h-full"
|
||||
disabled={submitted}
|
||||
></textarea>
|
||||
{#if attemptedSubmit && errorSlugs.message}
|
||||
<span class="text-sm text-red-500 absolute top-full">{$t(errorSlugs.message)}</span>
|
||||
@@ -87,6 +89,7 @@ const handleSubmit = () => {
|
||||
type="text"
|
||||
autocomplete="off"
|
||||
bind:value={form.name}
|
||||
disabled={submitted}
|
||||
/>
|
||||
{#if attemptedSubmit && errorSlugs.name}
|
||||
<span class="text-sm text-red-500 absolute top-full">{$t(errorSlugs.name)}</span>
|
||||
@@ -99,6 +102,7 @@ const handleSubmit = () => {
|
||||
type="email"
|
||||
autocomplete="off"
|
||||
bind:value={form.email}
|
||||
disabled={submitted}
|
||||
/>
|
||||
{#if attemptedSubmit && errorSlugs.email}
|
||||
<span class="text-sm text-red-500 absolute top-full">{$t(errorSlugs.email)}</span>
|
||||
|
||||
Reference in New Issue
Block a user