Replies: 2 comments
-
A possible way to solve this could be the following: <div hx-vals='{"key1": "val1", "key2": "val2"}'>
<input type="text" name="key1" hx-get="/some/path" hx-trigger="keyup delay:200ms" hx-vals='js:{key1: event.target.value}'>
</div> But for this to work with the |
Beta Was this translation helpful? Give feedback.
-
The commit you referenced links to PR #232 |
Beta Was this translation helpful? Give feedback.
-
This change was introduced in f2941b7.
I am wondering what was the reasoning behind it, the commit message unfortunately does not tell.
If we take the following example:
If we enter value
"input-val"
into the input text field here, the following request is executed:/some/path?key1=val1&key2=val2
.What I would expect and need here though is that the value of the input field is sent, i.e.
/some/path?key1=input-val&key2=val2
.I went through the source of the htmx library, and I think this is not possible with the current state of the library.
Putting a
hx-vals="unset"
on theinput
field would also not achieve what I need, as I still needkey2
to be sent alongside.Does anyone know why this change was made back then?
Does anyone do know a way how to achieve, what I'm describing?
Beta Was this translation helpful? Give feedback.
All reactions