If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.
Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.
Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.
Form Submission Fundamentals
If you're already familiar with Trongate's traditional form handling, you'll find that Trongate MX enhances the patterns you already know without replacing them. This page shows how to transform your existing Trongate forms into dynamic, single-page application experiences with minimal changes.
From Traditional to Dynamic Forms
Let's start with a familiar Trongate form and see how Trongate MX enhances it. Here's a traditional form you might already be using:
This form works perfectly - it submits to tasks/submit and causes a page reload. Now, let's see how Trongate MX enhances this with just one small change:
The key difference is the mx-post attribute, which transforms your application into a single-page application (SPA) experience. Your server-side code remains exactly the same!
Single Page Application Benefits
When you add mx-post to a form, you're transforming your application from traditional page-based navigation to a modern SPA experience. Trongate MX automatically:
- Eliminates page reloads and the jarring "white flash" between pages
- Maintains application state and scroll position
- Disables all form fields at the point of form submission
- Provides instant user feedback without navigation delays
- Creates a more responsive, app-like user experience
- Preserves all security features (CSRF protection, validation, etc.)
Server-Side Integration with Validation
Your existing controller methods can continue using Trongate's validation patterns that you're already familiar with:
Note: This is a foundational example to demonstrate basic concepts. In real-world applications, you'll likely use more sophisticated response handling such as mx-on-success, mx-redirect-on-success, or modal-based workflows, which we'll cover in later sections.
HTTP Methods in Trongate MX
Trongate MX supports various HTTP methods, though for most applications, mx-post will handle all your form submission needs:
Summary
Trongate MX transforms your existing forms into modern, single-page application experiences with minimal changes. By simply adding mx-post to your forms, you gain dynamic functionality while preserving all the Trongate patterns and security features you already know and trust.
In the next section, we'll explore how to add visual feedback like loading indicators to make your enhanced forms even more polished and professional.