salmon-xylophone-28580
07/28/2021, 1:15 PMshy-ability-59156
07/28/2021, 5:29 PMmysterious-toddler-20573
07/28/2021, 7:03 PMshy-ability-59156
07/28/2021, 7:11 PMhx-target="#search-results" while the descriptive text talks about response-div. Also the url is not the same. I'd suspect a copy&paste error. I'd send you a pr on github for the docs if you want.mysterious-toddler-20573
07/28/2021, 7:11 PMbillions-greece-86178
07/29/2021, 12:28 PMscript tag :/ dont't know if that's safe thoughshy-ability-59156
07/29/2021, 5:16 PM<form hx-post="/add-item" hx-trigger="submit">
<input name="search"
hx-get="/search-items"
hx-trigger="keyup changed delay:100ms"
hx-target=".options"
hx-include="[name='search']"
/>
<div class="options"></div>
</form>
This issues a GET-request when the user is typing like the existing example in the docs. Additionally, a parameter search is added to the request, which contains the text the user has entered into the input like so: /search-items?search=<text>. The response is simply added to the div.options. If the user submits the form (i. e. by pressing enter), the post request defined in the outer div is issued. Feel free to use it in the docs 😆 I'd also like to hear some suggestions for this, I'm quite new to htmx and like to improve! The hx-include references to it's own value, which looks a bit odd. This example lacks the option to click on one of the search results and copy it's value to the input. Working on that next.mysterious-toddler-20573
07/29/2021, 5:42 PMshy-ability-59156
07/29/2021, 6:58 PMgorgeous-airport-54386
07/30/2021, 7:14 PMshy-ability-59156
07/30/2021, 10:01 PMbillions-greece-86178
07/31/2021, 8:42 AMshy-ability-59156
07/31/2021, 8:53 AMhx-get?gorgeous-airport-54386
07/31/2021, 8:53 AMmysterious-toddler-20573
07/31/2021, 9:32 AMHX-Trigger header to trigger an event (my preferred approach)mysterious-toddler-20573
07/31/2021, 9:33 AMplain-kangaroo-26043
07/31/2021, 12:04 PMplain-kangaroo-26043
07/31/2021, 12:04 PMplain-kangaroo-26043
07/31/2021, 12:06 PMplain-kangaroo-26043
07/31/2021, 12:07 PMplain-kangaroo-26043
07/31/2021, 12:09 PMplain-kangaroo-26043
07/31/2021, 12:14 PMplain-kangaroo-26043
07/31/2021, 12:17 PMplain-kangaroo-26043
07/31/2021, 12:28 PMplain-kangaroo-26043
07/31/2021, 12:32 PMplain-kangaroo-26043
07/31/2021, 12:59 PMmysterious-toddler-20573
07/31/2021, 2:03 PMplain-kangaroo-26043
07/31/2021, 2:05 PMmysterious-toddler-20573
07/31/2021, 2:06 PMmysterious-toddler-20573
07/31/2021, 2:07 PM