I have a requirement to show a popup when (Multiselect or Select2) Dropdown is selected if the selected dropdown value having a "YES" value in db. I Posted a ajax call having the ID of current selected value of the dropdownlist.
Am getting values as array type, I need to get a value of the particular option which is selected by User. So that I will check that value having "YES" value in DB,
The problem is : Am getting value always as first selected item.
I Have tried these steps:
var id =
- $(".select2 option:selected").val();
- $(this).val();
- $(this).find('option:first').next().val();
- $(this).last().val();