Add to docs that form data overrides hx-include inputs with the same name(s)

Open Beginner friendly
#2,158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
documentation

Research direction

Open the hx-include documentation linked in the issue and read the getInputValues context shown there. Document that form values override included inputs with the same names, including the resulting merging behavior, and verify that the explanation matches the existing request behavior.

Written by the indexing model from the issue text.

Description

htmx 4

In the getInputValues function:

// form values take precedence, overriding the regular values
values = mergeObjects(values, formValues);

It would be neat if this detail was included in the hx-include doc.

I had a group of inputs from another place in the DOM that were hx-included in a form issuing an hx-post request, and these extra inputs had the same name as some of the form's (which was intentional, I wanted a merging of the values in an array to happen) and could not figure out why they were not sent along with the request.

Thank you!

Dominant language
JavaScript
Stars
49.5k
Forks
1.7k
Avg merge
4d 10h
Merged PRs (30d)
36

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bigskysoftware/htmx

All issues in bigskysoftware/htmx

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.