mercredi 21 octobre 2020

Change dropdown to multi-select checkbox in asp.net

I'm completely new to asp and I have a from in which the user has to select so many features from a dropdown list one in a time. It's frustrating and takes a lot of time. Now I'm thinking of changing this dropdown to a multi-select checkbox. This way user can choose all the features at once.

Here's my code:

    <div class="form-group row">
        <label class="control-label col-md-2" for="Title">Features</label>
        <div class="col-md-12 row">

            @Html.DropDownList("FeatureID", (SelectList)ViewBag.FeatureID, "-- Select ---", new { id = "FeatureID", @class = "form-control col-md-7" })

            <div class="col-md-5"  style="display: none">
                <input class="form-control" type="text" placeholder="Enter Feature Value" id="txtvalue"/>
                @*<textarea class="form-control" rows="5" type="text" placeholder="Enter Feature Value" id="txtvalue"></textarea>*@
            </div>
            <div class="col-md-2">
                <a class="btn btn-success " onclick="addFeature()">
                    <i class="zmdi zmdi-plus"></i>
                </a>
            </div>
        </div>
    </div>
    <div id="showfeaturelist">
        @Html.Action("ShowFeature")
    </div>

Any help would be much appreciated!




Aucun commentaire:

Enregistrer un commentaire