DEV Community

irishgeoffrey
irishgeoffrey

Posted on

Github pages forms

To create a GitHub Pages forms using Fabform.io, you can follow these steps:

  1. Sign up for Fabform.io:

  2. Create a form:

    • After signing up, create a new form by clicking on the "New Form" button.
    • Design your form according to your requirements by adding fields.
  3. Get the form endpoint:

    • Once your form is created, Fabform will provide you with a form endpoint. This is the URL where form submissions will be sent.
  4. Set up your GitHub Pages:

    • If you haven't already, create a GitHub repository for your website.
    • Create a new HTML file (e.g., contact.html) where you want to embed your form.
  5. Embed the form:

    • In your HTML file, create a form element.
    • Set the form's action attribute to the form endpoint provided by Fabform.
    • Add input fields for each form field you created in Fabform.
    • Example:
   <form action="https://fabform.io/f/your-form-endpoint" method="POST">
       <input type="text" name="name" placeholder="Your Name" required>
       <input type="email" name="email" placeholder="Your Email" required>
       <textarea name="message" placeholder="Your Message" required></textarea>
       <button type="submit">Submit</button>
   </form>
Enter fullscreen mode Exit fullscreen mode
  1. Commit and push changes:

    • Commit your changes to your GitHub repository and push them.
  2. Enable GitHub Pages:

    • Go to your repository's settings on GitHub.
    • Scroll down to the GitHub Pages section.
    • Choose the branch containing your website (e.g., main or master) and save the settings.

Your form should now be live on your GitHub Pages website, and submissions will be sent to Fabform for processing. You can view and manage form submissions from your Fabform.io dashboard.

Thats all you need to do to get GitHub Pages forms up and working. Enjoy!

Top comments (0)