-
Following is a example: I have a modal diag div like this: <div id="modal1" class="modal">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
</div>
<div class="modal-footer">
<a
href="#!"
class="modal-close waves-effect btn-flat"
hx-put=""
hx-swap="none"
>Agree</a>
</div>
</div> As you can see, i leave the <a
href="#modal1"
class="waves-effect waves-light btn modal-trigger"
script: "on mouseenter set @hx-put of <#modal1 a[hx-put]/> to '/users/1/update'"
>
Click me
</a> after i click on the above link, i can see the hx-put attribute set to "/users/1/update" correctly for <#modal1 a[hx-put]/> in the browser inspecter, but, after click the link use Yes, that means, set I don't know if this a bug, or may i do something wrong? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, htmx indeed parses the attributes on load, so it parses the blank |
Beta Was this translation helpful? Give feedback.
Hey, htmx indeed parses the attributes on load, so it parses the blank
hx-put
. For any situation where you want to update some htmx logic "from the outside" (for instance updating an attribute value after it has been parsed, inserting a node outside htmx's own swapping system), you will want to usehtmx.process
, after setting your newhx-put
value.This should make htmx process the new
hx-put
value correctly here.Let me know!