Topic: how can i get how many checkbox are checked in mdb vue checkbox component

modadvisor free asked 3 years ago


Dear sir,

How can i get how many checkbox are checked in vue js. i am using your checkbox component from here.

https://mdbootstrap.com/docs/vue/forms/checkbox/

i have tried using checkbox name but no luck to get how many checkbox has checked. can you please guide me how to do it. Thanks


Mikołaj Smoleński staff commented 3 years ago

Each checkbox state is handled by a v-model directive. To count all checked inputs, you will just need to find all "true" variables which were passed to a v-model.

Keep coding,  Mikołaj from MDB


modadvisor free commented 3 years ago

@Mikołaj Smoleński could you please write peace of example code because i were tried using js not worked. your help will be appreciated. thanks


modadvisor free commented 3 years ago

@Mikołaj Smoleński checkbox change event is firing before checkbox is checked that is an issue.


Mikołaj Smoleński staff commented 3 years ago

I made a code snippet for you: https://mdbootstrap.com/snippets/vue/mikolaj-smolenski/3150420

Keep coding,  Mikołaj from MDB



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Opened

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: MDB4 6.7.2
  • Device: PC
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: No
  • Provided link: Yes