'mmenu search: using more than one input value
I'm using mmenu query plugin (https://mmenujs.com/docs/addons/searchfield.html#h0) and want to get use the searchfield as a search form.
The default search on my Zencart site uses 3 inputs inside the form, two of which are type="hidden", the 3rd being used to display the input field for the search.
I set up my script as
document.addEventListener(
"DOMContentLoaded", () => {
new Mmenu("#menu", {
"navbars": [{
"position": "top",
"content": [
"searchfield"
]
}],
searchfield: {
//options
"placeholder": "Start searching..."
}
}, {
searchfield: {
//configuration
"form": {
action: "index.php?main_page=advanced_search_result",
method: "get"
},
input: {
type: "hidden",
name: "main_page",
value: "advanced_search_result"
},
input: {
type: "hidden",
name: "search_in_description",
value: "1"
},
input: {
type: "text",
name: "keyword",
id: "search-mobile",
value: "Search"
}
}
});
}
);
mmenu only seems to display the last "input" found in the script which means that the hidden input data is not available.
Is there any work around for this?
Fiddle available at https://jsfiddle.net/nsa17x6L/2/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
