Semantic-UI
Semantic-UI copied to clipboard
How to pass data to api url using dropdown?
how can i send input value to dropdown api url from another input value by name?
when i try like bellow but not send current value of filter_id input to api url of dropdown.
.dropdown({
apiSettings: {
url: '/get_category.php?type='+ $('input[name="filter_id"]').val(),
cache: false
},
thank you
Have you tried modifying the settings object with the beforeSend callback? Something like this should work:
apiSettings: {
beforeSend: settings => {
settings.url = `/get_category.php?type=${$('input[name="filter_id"]').val()}`;
return settings;
}
}