craftedbygc/taxi

How to use taxi.js best with a form that uses the method POST?

Sillkix opened this issue · 2 comments

I want to use taxi.js on many future website projects. But right now i don't really know how to best use it with a form that uses method POST. With cache activated i get an error and with cache disabled it reloads the page like it would without taxi. My first thought was to intercept the submit event and make an ajax request.

What would be your suggestions to implement this right now?

PS: Will there every be native support for such forms with method post?

Hi @Sillkix

Honestly I would use AJAX and the native js fetch API to submit the form as it is super simple, and beneficial to the user as they don't have to download any additional assets.

If I'm being honest, I had no plans to add form submission support (I assume GET would be needed as well to capture and ensure the query string was passed along) as it would be quite complex and would have to make assumptions about how that form was being handled.

Hi @Sillkix, Im going to close this issue now, but feel free to reopen if you have mroe questions!