Topic: Deropdown select with multiple clone not able to get value

modadvisor free asked 4 years ago


Dear Sir,

I have select drop down with dynamic add more features when i post data i am not able to getting index in the get value function. any possibility that i can pass any extra parameters ?

i have tried below code


modadvisor free commented 4 years ago

here is code snippet link

https://mdbootstrap.com/snippets/vue/modadvisor/2637643?action=forum_snippet


Mikołaj Smoleński staff answered 4 years ago


First of all, we recommend to use two-way data binding v-model instead of manual options applying. Here's an example code:

<mdb-select
  v-model="basicOptions"
  placeholder="Select an option"
  label=""
/>

and data:

data() {
  return {
    basicOptions: [
      { text: "Option nr 1", value: "Option 1" },
      { text: "Option nr 2", value: "Option 2" },
      { text: "Option nr 3", value: "Option 3" }
    ]
  };
}

After each change, picked option gets and attribute selected. You can easily get the selected item by filtering options (in this case it would be basicOptions).

Best regards



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: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 6.7.1
  • Device: PC
  • Browser: google chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No