LogoLogo
WebsitePricingGitHubSign up
  • Getting started
    • Installation and usage
    • Form settings
    • Options
    • Frequently asked questions
    • Spam protection
    • React
  • Customization
    • Theming
    • Localization
  • Input types
    • Text input
    • Email input
    • URL input
    • Telephone input
    • Password input
    • Number input
    • Select box
    • Choice input
    • Picture choice
    • Rating input
    • Opinion scale / Net Promoter ScoreĀ®
    • Datetime input
    • Date input
    • Time input
    • File input
  • Content
    • Slide
    • Start slide
    • End slide
    • Markdown
    • Data binding
    • CSS utility classes
  • Integrations
    • Google Sheets integration
Powered by GitBook

Ā© 2025 Forms.md | All rights reserved

On this page
  • Basic usage
  • Function overview
  • Arguments
  • Parameters
  • Examples
  • End slide with redirect
  • Basic end slide
  • End slide with restart button
  • FAQs
  • How do I run a function after form submission?

Was this helpful?

  1. Content

End slide

Add an end slide to create a completion page after form submission.

PreviousStart slideNextMarkdown

Last updated 4 months ago

Was this helpful?

Basic usage

An end slide with a thank you message is automatically added to every form, however, the endSlide() function can be used to customize this slide.

The endSlide() function creates a special slide type that acts as the final destination for your form. This slide will be shown after users complete and submit the form. You can also customize the slide to include a redirect URL that users will be taken to after form completion.

In the example below, the end slide contains a custom message (with some data binding).

import { Composer } from "formsmd";

const composer = new Composer({
  id: "my-form"
});

composer.emailInput("email", {
  question: "Join our mailing list",
  required: true
});

composer.endSlide({});

composer.h1("Thank you", {
  classNames: ["text-center"]
});
composer.p("Subscribed to mailing list with {$ email $}.", {
  classNames: ["text-center"]
});

Generates the following Markdown-like syntax:

#! id = my-form

email* = EmailInput(
  | question = Join our mailing list
)

---
-> end

# [.text-center] Thank you

[.text-center]
Subscribed to mailing list with {$ email $}.

Function overview

The following is the overview of the function:

endSlide(params: object)

Arguments

Name
Type
Description

params

object


Parameters

Name
Type
Description

redirectUrl

string

URL to redirect to from the end slide after form submission. This redirect is automatic.


Examples

End slide with redirect

In the example below, users will be automatically redirected to https://example.com/confirmation after form submission because of the redirectUrl.

composer.textInput("feedback", {
  question: "Any additional comments?",
  multiline: true
});

composer.endSlide({
  redirectUrl: "https://example.com/confirmation"
});

composer.h1("Submission complete");
composer.p("Thank you for taking the time to provide feedback.");

Generates the following Markdown-like syntax:

feedback = TextInput(
  | question = Any additional comments?
  | multiline
)

---
-> end -> https://example.com/confirmation

# Submission complete

Thank you for taking the time to provide feedback.

Basic end slide

In the example below, the end slide simply displays a completion message without redirecting.

composer.ratingInput("rating", {
  question: "How would you rate our service?",
  outOf: 5,
  required: true
});

composer.endSlide({});

composer.h1("Thanks for your rating!");
composer.p("We appreciate your feedback and will use it to improve our service.");

Generates the following Markdown-like syntax:

rating* = RatingInput(
  | question = How would you rate our service?
  | outOf = 5
)

---
-> end

# Thanks for your rating!

We appreciate your feedback and will use it to improve our service.

End slide with restart button

import { Composer } from "formsmd";

const composer = new Composer({
  id: "my-form",
  restartButton: "show"
});

composer.emailInput("email", {
  question: "Join our mailing list",
  required: true
});

Generates the following Markdown-like syntax:

#! id = my-form
#! restart-button = show

email* = EmailInput(
  | question = Join our mailing list
)

FAQs

An object containing all the configuration parameters for your end slide (see the below for the full list of options).

Set the restartButton to "show" to add a restart button to the end slide. When clicked, this button will restart the form from the very beginning.

form setting
How do I run a function after form submission?
parameters section
Slide containing the input
End slide
End slide with restart button