-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi button form ajax question #108
Comments
It might help if you had an example, but yes - you can have multiple buttons in the same form submit to different endpoints. Using
Using
This is just HTML though, nothing to do with Alpine AJAX. Adding |
Thanks, but, as I said, the buttons have their own handlers already, doing stuff different than submitting the form. So I don't actually want to submit the form, I just want the AJAX functionality. I will provide an example later. |
Here is an example, sort of:
|
@florian-sun Christian may have other suggestions, but intuitively, my first approach would be to use the $ajax helper within f1 and f2 to manually perform your Ajax request. https://alpine-ajax.js.org/reference/#ajax Alternatively, you could have a single function which accepts the endpoint & target as params which you provide in your click handlers. |
Ah, sorry, I missed your follow up message @florian-sun. But ditto to Justis’s suggestion 👍 |
This is not an issue, just a request for help. I don't see any Discussions tag so I'm asking here. If this is not appropriate, let me know and I'll delete this post.
So here is my setup. I have a form with several buttons, each with its own handler. Each button must do some stuff and then shd perform a different AJAX transformation.
Is this possible?
The text was updated successfully, but these errors were encountered: