millions-morning-77621
12/12/2021, 10:04 AMmillions-morning-77621
12/12/2021, 10:04 AMlimited-diamond-93357
12/12/2021, 12:34 PMlimited-diamond-93357
12/12/2021, 12:35 PMmillions-morning-77621
12/12/2021, 12:58 PMmillions-morning-77621
12/12/2021, 12:58 PMmillions-morning-77621
12/12/2021, 12:58 PMlimited-diamond-93357
12/12/2021, 1:09 PMmillions-morning-77621
12/12/2021, 1:09 PMmillions-morning-77621
12/12/2021, 1:10 PMmillions-morning-77621
12/12/2021, 1:10 PMmillions-morning-77621
12/12/2021, 1:10 PMmillions-morning-77621
12/12/2021, 1:11 PMlimited-diamond-93357
12/12/2021, 1:20 PMmillions-morning-77621
12/12/2021, 1:22 PMmillions-morning-77621
12/12/2021, 1:22 PMsilly-airline-58853
12/12/2021, 3:43 PMfierce-portugal-2651
12/13/2021, 11:03 AMprehistoric-cat-63987
12/13/2021, 11:36 AMfierce-portugal-2651
12/13/2021, 12:04 PMprehistoric-cat-63987
12/13/2021, 12:55 PMfast-baker-86727
12/13/2021, 9:18 PMbumpy-portugal-30413
12/13/2021, 9:20 PMbumpy-portugal-30413
12/13/2021, 9:24 PMfast-baker-86727
12/13/2021, 9:28 PMif no-errors:
return response(new_full_page)
else if errors:
return HtmxResponse(errors)
Like can I manually add headers to my response to do something like this? Or am I thinking about it completely wrong? 🤔fast-baker-86727
12/13/2021, 9:34 PMbumpy-portugal-30413
12/13/2021, 9:40 PMif no-errors:
return response(new_full_page)
else if errors:
return render(request, component, {"errors": errors})
in the component is your html template that has the form which will replace the form on the page using the hx-target and swapbumpy-portugal-30413
12/13/2021, 9:44 PMbumpy-portugal-30413
12/13/2021, 9:48 PMresponse = render(request, component, {"errors": errors})
response[HX-Trigger] = "eventName"
return response
Then listen for that event. I used that to update an element when other elements were updated.
I haven't used redirect so I assume you set the url as the header? There isn't a doc page for that one.fast-baker-86727
12/13/2021, 9:53 PMresponse['Hx-Redirect'] = "some/url/here"
(if that's the syntax--like you said, it doesn't have a doc page) is maybe what I'm looking for