mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
Change how getInputValues() works
This commit is contained in:
parent
64f7aa2cf9
commit
591954e72d
14
src/htmx.js
14
src/htmx.js
@ -1556,12 +1556,16 @@ return (function () {
|
||||
|
||||
function getInputValues(elt, verb) {
|
||||
var processed = [];
|
||||
var values = {};
|
||||
var values = {
|
||||
form: {},
|
||||
element: {},
|
||||
includes: {},
|
||||
};
|
||||
var errors = [];
|
||||
|
||||
// for a non-GET include the closest form
|
||||
if (verb !== 'get') {
|
||||
processInputValue(processed, values, errors, closest(elt, 'form'));
|
||||
processInputValue(processed, values.form, errors, closest(elt, 'form'));
|
||||
}
|
||||
|
||||
// include the element itself
|
||||
@ -1572,12 +1576,14 @@ return (function () {
|
||||
if (includes) {
|
||||
var nodes = getDocument().querySelectorAll(includes);
|
||||
forEach(nodes, function(node) {
|
||||
processInputValue(processed, values, errors, node);
|
||||
processInputValue(processed, values.includes, errors, node);
|
||||
});
|
||||
}
|
||||
|
||||
var mergedValues = mergeObjects(values.includes, values.form);
|
||||
mergedValues = mergeObjects(mergedValues, values.element);
|
||||
|
||||
return {errors:errors, values:values};
|
||||
return {errors:errors, values:mergedValues};
|
||||
}
|
||||
|
||||
function appendParam(returnStr, name, realValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user