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
PR #3094 added support for including form values when a button outside a form is used for submission.
Currently, if the request is GET, this will not happen:
// for a non-GET include the related form, which may or may not be a parent element of elt
if (verb !== 'get') {
processInputValue(processed, priorityFormData, errors, getRelatedForm(elt), validate)
}
this should be changed to
if (verb !== 'get' || (elt.form && elt.hasAttribute('form'))) { }
However, tests will need to be added to make sure we're not altering existing "link-like" behavior. Comments from Carson for reference:
htmx has not submitted values for GETs that occur within a form so that link-like things do not include them when navigating. This behavior may not be ideal but we can't change it without breaking backwards compatibility. (In general at this point backwards compatibility is becoming more important than correctness in htmx.)
I think the situation where the user has explicitly called out a form via the form attribute is obvious enough to fix so I'm in favor of this change so long as it minimizes any additional changes, in particular with an eye towards backwards compatibility.
and
basically a form always includes all. params, even if it's a GET
everything else sends enclosing form values on a non-GET
The text was updated successfully, but these errors were encountered:
PR #3094 added support for including form values when a button outside a form is used for submission.
Currently, if the request is
GET
, this will not happen:this should be changed to
However, tests will need to be added to make sure we're not altering existing "link-like" behavior. Comments from Carson for reference:
and
The text was updated successfully, but these errors were encountered: