craftedbygc / taxi

Taxi is a 🤏 small and 🐊 snappy js library for adding slick PJAX navigation and beautiful transitions to your website.
https://taxi.js.org
565 stars 11 forks source link

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

Closed Sillkix closed 1 year ago

Sillkix commented 1 year ago

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?

jakewhiteley commented 1 year ago

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.

jakewhiteley commented 1 year ago

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