Closed faizanakram99 closed 1 year ago
Hi @faizanakram99 ,
If the form is added to the DOM by some JS, you need to make htmx parse it, by using htmx.process().
Hi @faizanakram99 ,
If the form is added to the DOM by some JS, you need to make htmx parse it, by using htmx.process().
Thanks, that works.
Sorry to bump this up, but if I call the htmx.process()
inside the onConnectedCallback
method, does that require of a call to a possible unsubscribe method from htmx? Something that should go into the disconnectedCallback
part I mean.
In other words, does calling htmx.process inside a web component that connects and disconnects from the DOM lead to a memory leak?
I've this form, it is added dynamically via javascript but when i click the Submit button, the whole form is submitted with get method via browser (not via ajax) and whole page reloads.
What I am doing wrong ?
I tried adding
hx-trigger="submit"
, doesn't help.The form is inside fast-tab-panel from (fast.design) web components (if it helps)
"htmx.min.js" is included in the page