0

I have two multi select list one which holds a full list of names and the second one holds the names that were selected from the first list. The names are stored in Vue array which populates the names into the second select list, but when I submit the form that this is all held I get null for the result of the values in the second multi select.

<select multiple style="width: 300px; height: 200px;">
      <option v-for="item in Selected" name="Signatures" selected>{{ item }</option>
</select>

var signatures = new Vue({
        el: '#signatures',
        data: {
            Selected: []
        }
    })

Below is my controller, the model is not needed in this portion as the data is just going to the server side to be stored into variables for next page.

public ActionResult LoadTextFile(MainVM vM)
        {
            string size = Request.Form["Size"];
            string document = Request.Form["Document"];
            string tribute = Request.Form["Tribute"];
            string date = Request.Form["date"];
            string signatures = Request.Form["Signatures"];
            return View();
        }

I'm trying to get the values of the select list using Request.form("Signatures");

I'm hoping there is either a way for me to submit all of the values in the select list over using a JavaScript framework or C#.

1 Answers1

0

After reading this post I realized that what I need to do was add the square brackets to the name.

The end result was:

<select multiple style="width: 300px; height: 200px;" name="Signatures[]">
                        <option v-for="item in Selected" selected>{{ item }}</option>
                    </select>
string signatures = Request.Form["Signatures[]"];