Relative Content

Tag Archive for htmx

Call htmx:after-on-load after successful hx-post

I have a form in a boostrap modal that I am posting with HTMX. The post is working great and so is validation. The problem is the successful submit response. I am returning ASP.NET MVC Ok(); method which returns 200.

Clear target innerHTML using HTMX

I have a Boostrap modal that I want to reuse. I pop it up with a different VendorId each time. I want to be able to clear the modal body before the HTMX AJAX (hx-get) is complete, so the old HTML from the previous Vendor ID does not show during the HTMX request.

Possible to disable HTMX’s swapping and just load the page as usual?

I only want to use HTMX to trigger a POST to a different endpoint inside a form (since nested forms aren’t allowed). I’ve got it working, but I don’t seem to be able to disable it, and have it just do a dumb full-page reload. It’s interfering with my other JS and I don’t want to get into fixing it.