HTML
HTML (HyperText Markup Language) is the standard markup language used to structure content on the web. It defines the elements and layout of a webpage, such as headings, paragraphs, images, links, and more, providing the foundation for web development.
Prerequisites
Before you begin, make sure you have:
- A Basestack Forms account
- An HTML form ready to integrate
Don't have a form yet? You can find example forms in the Setup tab of your Basestack Forms Dashboard.
Quick Setup Guide
Follow these simple steps to connect your HTML form to Basestack Forms:
Update your form's action attribute
Configure your form's action attribute to point to your Basestack Forms endpoint. The endpoint URL format is:
https://forms-api.basestack.co/v1/s/[KEY]?mode=restReplace [KEY] with your form's unique key, which you can find in your Basestack Forms Dashboard under the Setup tab.
Also ensure your form's method attribute is set to POST.
Add name attributes to all form fields
Every form input must have a name attribute for Basestack Forms to collect the data. This includes:
- Text inputs (
<input type="text">) - Email inputs (
<input type="email">) - Textareas (
<textarea>) - Checkboxes (
<input type="checkbox">) - Radio buttons (
<input type="radio">) - File inputs (
<input type="file">)
Fields without a name attribute will be ignored and won't be collected in your submissions.
Test your form
Your form is now configured and ready to collect submissions! Use the example code below as a reference or starting point for your own form.
<!-- modify this form HTML as you wish -->
<form
action="https://forms-api.basestack.co/v1/s/[KEY]?mode=rest"
method="POST"
enctype="multipart/form-data"
>
<div>
<label for="name">Name:</label>
<!-- name each of your inputs as you wish -->
<input
type="text"
id="name"
name="name"
required
autocomplete="name"
aria-label="Name"
placeholder="Enter your name"
/>
</div>
<div>
<label for="email">Email:</label>
<input
type="email"
id="email"
name="email"
required
autocomplete="email"
aria-label="Email"
placeholder="Enter your email"
/>
</div>
<div>
<label for="message">Message:</label>
<textarea
id="message"
name="message"
required
aria-label="Message"
placeholder="Enter your message"
></textarea>
</div>
<!-- your other form fields go here -->
<button type="submit">Submit</button>
</form>Attaching files
Basestack Forms accepts file uploads through the same endpoint after you enable File Uploads in Settings → General (off by default on new forms). The <form> already has enctype="multipart/form-data" in the example above. Add an <input type="file" name="..."> field and the file will be uploaded with the submission.
Each file must be 1 MB or smaller, and a single submission may include at most 5 files. The server rejects submissions that exceed either limit with an HTTP 413 response. See File Uploads → for full details.
Simple example: single file
A contact form with a single attachment (for example a resume):
<form
action="https://forms-api.basestack.co/v1/s/[KEY]"
method="POST"
enctype="multipart/form-data"
>
<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>
<label for="resume">Resume (PDF, max 1 MB):</label>
<input type="file" id="resume" name="resume" accept="application/pdf" />
<button type="submit">Send</button>
</form>Complex example: multiple files with validation hints
A job-application form that accepts a CV plus several supporting documents. The multiple attribute lets the user pick more than one file under the same field name; the accept attribute hints the file picker to filter by type (this is a UX hint only, the server validates the actual content type).
<form
action="https://forms-api.basestack.co/v1/s/[KEY]"
method="POST"
enctype="multipart/form-data"
>
<input type="text" name="full_name" placeholder="Full name" required />
<input type="email" name="email" placeholder="Email" required />
<input type="text" name="role" placeholder="Role you're applying for" required />
<label for="cv">CV (required):</label>
<input
type="file"
id="cv"
name="cv"
accept="application/pdf,.doc,.docx"
required
/>
<label for="portfolio">Portfolio samples (up to 4):</label>
<input
type="file"
id="portfolio"
name="portfolio"
accept="image/*,application/pdf"
multiple
/>
<button type="submit">Apply</button>
</form>Across all file fields combined, no more than 5 files can be attached to a single submission. In the example above, the CV counts as 1, so the user can include up to 4 portfolio samples.