templBasicCombobox(){<divclass="h-96"><formhx-post="/combobox-submit/example_combo"class="space-x-4">@components.Combobox(components.ComboboxProps{Name:"example_combo",Label:"Example",URL:"/combobox/%s/%s",Options:[]string{"Thing 1","Thing 2","Thing 3","Thing 4","Thing 5","Thing 6","Thing 7",},})<buttontype="submit"class="btn btn-sm btn-primary">Submit</button><script>// update the form to only include half of the input values
// corresponding to the combobox's name since it will contain enabled checkbox values as well
((form)=>{form.addEventListener("htmx:configRequest",(evt)=>{letvalues=evt.detail.parameters["example_combo"]if(values!==undefined){evt.detail.parameters["example_combo"]=values.slice(0,Math.floor(values.length/2))}})})(document.currentScript.parentElement)</script></form></div>}
funcPostCombobox(cecho.Context)error{name:=c.Param("name")value:=c.Param("value")returnrender(c,http.StatusOK,components.ComboBadge(name,value))}funcPostComboboxSubmit(cecho.Context)error{urlValues,err:=c.FormParams()iferr!=nil{returnnewErrorToast(http.StatusUnprocessableEntity,"unable to parse form data")}name:=c.Param("name")comboboxPostData:=urlValues[name]returnrenderInfoFade(c,http.StatusOK,comboboxPostData)}