Skip to content

Implementing Form Confirmation Dialog #679

Answered by mehdikhody
mehdikhody asked this question in Help
Discussion options

You must be logged in to vote

Thank you for your response. Later that day, I achieved what I wanted through experimentation and searching in the documentation to find a method suitable for me. Here's what I came up with:

<script lang="ts">
  import type { SuperValidated } from "sveltekit-superforms";
  import type { FormOptions } from "formsnap";
  import type { SetupSchema } from "./schema";
  import { setupSchema } from "./schema";
  import * as Form from "$shadcn/form";
  import * as AlertDialog from "$shadcn/alert-dialog";
  
  export let form: SuperValidated<SetupSchema>;
  
  let formEl: HTMLFormElement;
  let disableSubmit = false;
  let showDialog = false;
  let confirmed = false;
  
  const options: FormOptions<

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@shyakadavis
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by mehdikhody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
type: documentation A change or addition to the documentation
3 participants
Converted from issue

This discussion was converted from issue #678 on January 21, 2024 16:09.