You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
instance.fields.value() not getting value from submitter #15908
Remote form enhance callback does not get the value from the submit button in instance.fields.value(). Repro linked below shows that the remote handler gets the value, but not the enhance callback. The submitter value was present in the deprecated data value prior to 2.61.
instance.fields.value() relies on the handle_input event handler to listen to inputs and update the value each time an input even happens. This doesn't work for forms with multiple named submit buttons because they don't trigger that event to fire.
One potential option to resolve this is to check if the event.submitter is a button with a name and value and update the state within handle_submit. That could be achieved with something like this:
jk this doesn't actually solve it because it doesn't clear if you hit a different submit button. that complexity really makes me lean more towards trying to take advantage of the already existing form_data in handle_submit
Activity
lettucebowler commentedon Jun 3, 2026
instance.fields.value() relies on the handle_input event handler to listen to inputs and update the value each time an input even happens. This doesn't work for forms with multiple named submit buttons because they don't trigger that event to fire.
One potential option to resolve this is to check if the event.submitter is a button with a name and value and update the state within handle_submit. That could be achieved with something like this:
if (event.submitter instanceof HTMLButtonElement && event.submitter.name && event.submitter.value !== undefined) { set_nested_value(input, event.submitter.name, event.submitter.value); }I imagine more would need to happen beyond this to ensure validation, populating issues, etc,
I do have to say though that this feels way more complicated than the pre-2.61 approach where the enhance callback had access to the data
lettucebowler commentedon Jun 5, 2026
jk this doesn't actually solve it because it doesn't clear if you hit a different submit button. that complexity really makes me lean more towards trying to take advantage of the already existing form_data in handle_submit