Skip to content

Data Attributes

The Webflow script uses data-* attributes to configure form behavior without writing any JavaScript.

Required. Set on the <form> element to connect it to Formtress.

DetailValue
Element<form>
ValueYour Form ID from the dashboard
RequiredYes
<form data-ft="your-form-id-here">
<!-- fields -->
</form>

Optional. Set on the text element inside your submit button. When the form is submitting, the text content is replaced with this value. It’s restored when the request completes.

DetailValue
ElementText element inside the submit button
ValueLoading text string (e.g., "Please wait...", "Sending...")
RequiredNo
<button type="submit">
<span data-ft-loading-text="Please wait...">Submit</span>
</button>

Optional. Set on an element that should display error messages from the server. When a submission fails, the text content of this element is replaced with the error message.

DetailValue
ElementAny element (typically a <div> or <p>)
Value(no value needed — presence of the attribute is enough)
RequiredNo
<div data-ft-error>Something went wrong.</div>

The default text (e.g., “Something went wrong.”) is shown initially. When an error occurs, it’s replaced with the server’s error message.

<form data-ft="abc123-your-form-id">
<label for="name">Name</label>
<input type="text" id="name" name="name" required />
<label for="email">Email</label>
<input type="email" id="email" name="email" required />
<label for="message">Message</label>
<textarea id="message" name="message"></textarea>
<!-- Error display -->
<div data-ft-error>Something went wrong. Please try again.</div>
<!-- Submit button with loading text -->
<button type="submit">
<span data-ft-loading-text="Sending...">Send Message</span>
</button>
</form>