Topic: multiselect close

Gerard Fossoul pro asked 4 years ago


How can I make the multiselect execute a function when losing focus or exiting?

I have this function:

$('#selectEmp').on('change',function(e) { ....

but it works for me by pressing an option, I want it to work when I lose the focus or exit.

I have tried 'close', 'lostfocus', 'blur' and there is no way


Tomek Makowski staff answered 4 years ago


Hi

Try out this solution

https://mdbootstrap.com/snippets/jquery/tomekmakowski/2260001?view=project#js-tab-view

Here i added blur event on input.select-dropdown because original input element is replace with it

Regards


Gerard Fossoul pro answered 4 years ago


and i want know the people select a diferent option..... because i open the select and don0t select anything, when i go out, the function is run.... I want that don't run if i don't select any option...


Tomek Makowski staff commented 4 years ago

check it now

https://mdbootstrap.com/snippets/jquery/tomekmakowski/2260001?view=project#js-tab-view

Now you have list of active options


Gerard Fossoul pro answered 4 years ago


other question, i have more than one multiselect, how i know the actual select?

input.select-dropdown or #idselect.select-dropdown


Gerard Fossoul pro answered 4 years ago


perfect is asolution!



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: pc
  • Browser: chrome
  • OS: windows10
  • Provided sample code: No
  • Provided link: No