I am trying to send the current value of the Search Dropdown to an API. I can't figure out what to send into urlData.value
. I tried $(this)
and $(this).val()
and a number of other options but none worked.
$('.ui.dropdown').dropdown({
minCharacters: 2,
apiSettings: {
cache: false,
url: `http://localhost/search?text={value}`,
urlData: {
value:$(this)
},
...
}
});
Turns out I didn't have to use urlData
at all. Just need to specify {query}
in url
.
url: `http://localhost/search?text={query}`