biff

Nik 2025-10-31T12:31:58.766749Z

Hi Guys, I'm trying to update form parameters using hyperscript and listening to htmx:configRequest but I'm not able to make it work. Is there something very obvious that I'm missing 😅 other events like input was working (paired with log) I tried bunch of other events and I'm checking BE logs, htmx.logAll() + offline in network tab of browser devtools etc) to see if it works for eg

[:input#amount.mt-1.block.w-full.rounded-md.border.border-gray-300.py-2.px-3.shadow-sm.focus:border-blue-500.focus:outline-none.focus:ring-1.focus:ring-blue-500
           {:type "number"
            :name "amount"
            :required true
            :step "0.1"
            :_ "on htmx:trigger
                  log 'Form submitting...'
                "
            :placeholder "Enter amount in ₹"}]

2025-11-01T11:19:12.984209Z

hm, I haven't used https://htmx.org/events/#htmx:configRequest before but it seems like that ought to do what you want. Let me try it...

2025-11-01T11:22:07.100959Z

maybe your problem is you need to put the hyperscript handler on the form element, not the input element

2025-11-01T11:29:34.810269Z

This snippet works for me:

[:form
 {:hx-post "/test-config-request"
  :_ "on htmx:configRequest set event.detail.parameters.auth_token to 'abc123'"}
 [:input
  {:type "number"
   :name "amount"
   :required true
   :step "0.1"
   :placeholder "Enter amount in ₹"}]
 [:button {:type "submit"} "submit"]]
I had to put the :_ on the form element, and I also had to use :hx-post on the :form instead of a plain :action which seems obvious in hindsight but was something I missed initially.

2025-11-01T11:30:46.774759Z

doing that, I'm able to see auth_token in the request params in the network tab:

Nik 2025-11-01T13:15:42.039179Z

Awesome 🤩 Thanks! @foo

🙌 1