-
Notifications
You must be signed in to change notification settings - Fork 2
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
htmxify #2
Comments
you actually can without any change 😄 . short example it your template you would do something like this :
<form class="space-y-6" hx-put="/config" hx-target=".element-form-container" hx-ext="json-enc-nested,notify">
{{ form_render .Data.Form .Data.Errors "Loc" .Loc }}
<div class="flex items-center justify-between">
<button type="submit" class="inline-flex items-center rounded-md bg-orange-500 dark:bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-orange-700 ">Update Form</button>
</div>
</form> as you can see here, we can put all the hx attributes on the form element. on the receiving end, in this case the put:config route we can validate and either respond with an I'm a bit in doubt on where to place the full example as i don't want to create dependances between the two packages. |
hey @donseba
I see what you mean. I actually use this pattern all the time. Here is what a Makefile looks like that wants a repo and to ensure it's an "island". go.work is a god send.... git clone https://github.com/donseba/go-form
@echo go-form >> .gitignore
touch go.work
go work use ./go-form |
with https://github.com/donseba/go-htmx
The text was updated successfully, but these errors were encountered: