Topic: No onclose event after clear

sdpollack premium asked 2 years ago

I am using the onclose event on the select component to submit the form after it is closed. I would like to use the clear button, but it does not raise a onclose event. Is there another event I can use to detect when the clear button was pressed?

<select class="form-select select"  data-mdb-filter="true" data-mdb-clear-button="true" multiple asp-for="selectedBadges" asp-items="Model.badgeOptions" onclose="this.form.submit()">

Dawid Wajszczuk staff answered 2 years ago


There is no event for this. But you can write your own. Here is the snippet:

Keep coding,

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.11.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No