mardi 21 août 2018

Razor: Select multiple checkboxes generated in a foreach loop

I have a frontend page made with Razor, where I generate multiple checkboxes according to the size of a list:

foreach (var listItem in Model.ListItems)
{
   <label class="checkbox-inline">
       <input type="checkbox" name="listName" value="@listItem.Att" />
          Checkbox text: @listItem.Att
    </label>

}

How can I make possible for the frontend user to select multiple of those checkboxes at once? Usually frontend pages offer us the possibility of clicking one checkbox then clicking Ctrl + mouse click on another checkbox to select multiple at once. Is it possible to configure this?




Aucun commentaire:

Enregistrer un commentaire