How can i get Chips data using mdb...


Topic: How can i get Chips data using mdb...

linglecai asked 3 years ago

I'm a newcomer here, and code like this

...
<div class="chips chips-placeholder" name="keyword" id="id_keyword"></div>
...

and i need my app user to type in some tags,

how can i get data posted so i can read the tags they typed in and save it to my database?

i've tried many solutions on stackoverflow and other ones, basically using JavaScript, but still, i cant get it work, and i think the API doc to this is a little poor, perhaps just me being foolish...

can anybody answer my question?


Grzegorz Bujański staff answered 3 years ago

You can use add.mdb.chips:

const myChips = document.getElementById('myChipsID')
myChips.addEventListener('add.mdb.chips', (e) => {
    // do something...
})

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
  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.10.1
  • Device: Computer
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No