categories select2 ajax

$(document).on('change', '#categories_select_element', function () { // reset options of sub categories select element $('#subCategories_element').html(""); // fetch data from function by select2 $('#subCategories_element').select2({ ajax: { url: "function route", dataType: 'json' } }) })

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.