-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty inputs are not being sent via POST, or undefined
if explicitly sent
#33
Comments
what sort of inputs are these? |
if we can boil down a simple example I can get a test and fix in for 0.0.4 on monday |
Here is what I used to isolate & confirm my test (uses PHP to echo the params sent):
If you submit it with a value in the input, it shows up in the Thanks for your help! :) |
OK, added a regression test and fix in This will go out on monday w/ the 0.0.4 release. Thank you for catching it! |
I have a form that needs to POST an empty field value. In my context, an empty value denotes removing a coupon code from a user's cart.
However when I make a simple HTML form, and bind htmx to it, if the coupon code field is empty then it is not included in the POST request.
I have tried using
hx-params="*"
on the form element, but this has no effect, still only non-empty fields are POSTed.Interestingly, when I explicitly mentioned the input field in question, e.g.
hx-params="couponCode"
, while it did POST that form param, the value sent wasundefined
. I tried setting name and id attributes tocouponCode
but both yieldedundefined
...Thanks for your help!
htmx version: 0.0.3
The text was updated successfully, but these errors were encountered: