Skip to content

Multiple select tags, on change, pass all values #1554

Closed Answered by Telroshan
jritsema asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, check out this JSFiddle for an example implementation.

<select name="filter1">
  <option value="1">1</option>
  <option value="2">2</option>
</select>
<select name="filter2">
  <option value="A">A</option>
  <option value="B">B</option>
</select>


<div hx-get="/url" hx-include="select" hx-trigger="change from:select">
 Content will be swapped here
</div>
  • Use hx-get to issue GET requests. Similarly, use hx-post to issue a POST request instead
  • Use hx-include when you can't use a form or need to include elements that are elsewhere in the DOM hierarchy, to include the required values
  • Use hx-trigger to specify when the request should be sent. Here, I used the standard change event, al…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jritsema
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants