Vue js multiselect list , i want to get the selected values from the list and send it to the Symfony Controller with axios

in App.vue

<multiselect
            v-model="value"
            :multiple="true"
            tag-placeholder="Add this as new tag"
            placeholder="Search or add a tag" 
            label="email"
            track-by="email"
            :options="users"
            :taggable="true" @tag="addTag"
            @select="toggleSelected">
          </multiselect>
         <input type="text" name="users[]" v-for="user in value" :value="user.email" v-bind:key="user.id">  


data() {
    return {
     users:[],
     value: null,
     selectedPersonen: [],
     test:false,
    };
  },

methods : {
     create :function () {
     const themaName = document.querySelector("input[name=topic]").value;
     const themaUrl = document.querySelector("input[name=url]").value;
     const themaDate = document.querySelector("input[name=trip]").value;
     const themaText = document.querySelector("textarea[name=text]").value;
     //const emails = document.querySelector("input[name=users]").value;
     console.log(emails);
     axios.post('url',{
        themaName,themaUrl,themaDate,themaText
      })
      .then(response =>{
       
       console.log(response.config.data)
      
      })
     
     },

my question is how can i get the selected userEmails and send this to the Controller i have tried to get the values with the querySelector i got no results.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *