Skip to content

Data Attributes

The Webflow script progressively enhances forms whose action points to Formtress. These data-* attributes are optional — they add loading text and server error display without writing any JavaScript.

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 action="https://app.formtress.com/api/f/abc123-your-form-id" method="post">
<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>